From 258bfc00c3107360a28f06e170d58e84b2db211a Mon Sep 17 00:00:00 2001 From: Niklas Date: Fri, 26 Jun 2020 17:38:14 +0200 Subject: [PATCH] improved component structure --- .../{PlayerDeathListener.java => DropHead.java} | 5 +++-- .../java/org/kapelle/hardcore_revive/HardcoreRevive.java | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) rename src/main/java/org/kapelle/hardcore_revive/{PlayerDeathListener.java => DropHead.java} (88%) diff --git a/src/main/java/org/kapelle/hardcore_revive/PlayerDeathListener.java b/src/main/java/org/kapelle/hardcore_revive/DropHead.java similarity index 88% rename from src/main/java/org/kapelle/hardcore_revive/PlayerDeathListener.java rename to src/main/java/org/kapelle/hardcore_revive/DropHead.java index bb748c4..b2d5efe 100644 --- a/src/main/java/org/kapelle/hardcore_revive/PlayerDeathListener.java +++ b/src/main/java/org/kapelle/hardcore_revive/DropHead.java @@ -11,11 +11,12 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.plugin.java.JavaPlugin; -public class PlayerDeathListener implements Listener { +public class DropHead implements Listener { private JavaPlugin plugin; - public PlayerDeathListener(JavaPlugin plugin){ + public DropHead(JavaPlugin plugin){ this.plugin = plugin; + plugin.getServer().getPluginManager().registerEvents(this, plugin); } @EventHandler diff --git a/src/main/java/org/kapelle/hardcore_revive/HardcoreRevive.java b/src/main/java/org/kapelle/hardcore_revive/HardcoreRevive.java index 7d2ac84..3962afa 100644 --- a/src/main/java/org/kapelle/hardcore_revive/HardcoreRevive.java +++ b/src/main/java/org/kapelle/hardcore_revive/HardcoreRevive.java @@ -3,10 +3,12 @@ package org.kapelle.hardcore_revive; import org.bukkit.plugin.java.JavaPlugin; public class HardcoreRevive extends JavaPlugin { + DropHead dropHead; @Override public void onEnable() { this.getLogger().info("hardcore-revive plugin enabled"); - this.getServer().getPluginManager().registerEvents(new PlayerDeathListener(this), this); + + dropHead = new DropHead(this); } } \ No newline at end of file