diff --git a/gradle.properties b/gradle.properties index 3cfa4f2..d2a2f3e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true # Plugin -plugin_version=0.1.0 +plugin_version=0.1.1 plugin_group=xyz.twokilohertz plugin_base_name=playerlistdeathcount diff --git a/src/main/java/xyz/twokilohertz/playerlistdeathcount/PlayerListDeathCount.java b/src/main/java/xyz/twokilohertz/playerlistdeathcount/PlayerListDeathCount.java index c830dc5..609ef26 100644 --- a/src/main/java/xyz/twokilohertz/playerlistdeathcount/PlayerListDeathCount.java +++ b/src/main/java/xyz/twokilohertz/playerlistdeathcount/PlayerListDeathCount.java @@ -1,13 +1,23 @@ package xyz.twokilohertz.playerlistdeathcount; +import org.bukkit.event.HandlerList; +import org.bukkit.event.Listener; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import xyz.twokilohertz.playerlistdeathcount.listeners.PlayerEventListener; public class PlayerListDeathCount extends JavaPlugin { + private Listener playerEventListener; + @Override public void onEnable() { PluginManager pluginManager = getServer().getPluginManager(); - pluginManager.registerEvents(new PlayerEventListener(), this); + playerEventListener = new PlayerEventListener(); + pluginManager.registerEvents(playerEventListener, this); + } + + @Override + public void onDisable() { + HandlerList.unregisterAll(playerEventListener); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 819e699..9b689b2 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: PlayerListDeathCount -version: 0.1.0 +version: 0.1.1 description: Show the number of deaths players have in the server online player list author: twokilohertz website: https://git.2khz.xyz/adam/PlayerListDeathCount