Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
<id>paper-mc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -38,9 +42,15 @@
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.2</version>
<version>7.0.13-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.NahuLD.folia-scheduler-wrapper</groupId>
<artifactId>folia-scheduler-wrapper</artifactId>
<version>v0.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>

<profiles>
Expand Down Expand Up @@ -72,6 +82,30 @@

<build>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>me.nahu.scheduler.wrapper</pattern>
<shadedPattern>de.themoep.entitydetection.folia.scheduler</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<filtering>true</filtering>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/themoep/entitydetection/EntityDetection.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import de.themoep.entitydetection.searcher.SearchResult;
import de.themoep.entitydetection.searcher.SearchResultEntry;
import de.themoep.entitydetection.searcher.SearchType;
import me.nahu.scheduler.wrapper.FoliaWrappedJavaPlugin;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
Expand All @@ -17,7 +18,6 @@
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
Expand All @@ -44,7 +44,7 @@
* You should have received a copy of the Mozilla Public License v2.0
* along with this program. If not, see <http://mozilla.org/MPL/2.0/>.
*/
public class EntityDetection extends JavaPlugin {
public class EntityDetection extends FoliaWrappedJavaPlugin {

private EntitySearch currentSearch;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package de.themoep.entitydetection.searcher;

import de.themoep.entitydetection.EntityDetection;
import me.nahu.scheduler.wrapper.runnable.WrappedRunnable;
import me.nahu.scheduler.wrapper.task.WrappedTask;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Material;
Expand All @@ -9,8 +11,6 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -34,7 +34,7 @@
* You should have received a copy of the Mozilla Public License v2.0
* along with this program. If not, see <http://mozilla.org/MPL/2.0/>.
*/
public class EntitySearch extends BukkitRunnable {
public class EntitySearch extends WrappedRunnable {
private final EntityDetection plugin;
private final CommandSender owner;
private SearchType type = SearchType.CUSTOM;
Expand Down Expand Up @@ -117,7 +117,7 @@ public long getDuration() {
return (System.currentTimeMillis() - getStartTime()) / 1000;
}

public BukkitTask start() {
public WrappedTask start() {
if (searchedEntities.size() > 0) {
for (World world : plugin.getServer().getWorlds()) {
entities.addAll(world.getEntities());
Expand All @@ -130,7 +130,7 @@ public BukkitTask start() {
}
}
}
return runTaskAsynchronously(plugin);
return runTask(plugin);
}

public boolean isRunning() {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: ${project.name}
main: de.themoep.entitydetection.EntityDetection
version: '${minecraft.plugin.version}'
api-version: 1.13
folia-supported: true
description: '${project.description}'
softdepend: ["WorldGuard"]
authors: [Phoenix616]
Expand Down