improved component structure

This commit is contained in:
Niklas 2020-06-26 17:38:14 +02:00
parent 79de05fb84
commit 258bfc00c3
2 changed files with 6 additions and 3 deletions

View File

@ -11,11 +11,12 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class PlayerDeathListener implements Listener { public class DropHead implements Listener {
private JavaPlugin plugin; private JavaPlugin plugin;
public PlayerDeathListener(JavaPlugin plugin){ public DropHead(JavaPlugin plugin){
this.plugin = plugin; this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
} }
@EventHandler @EventHandler

View File

@ -3,10 +3,12 @@ package org.kapelle.hardcore_revive;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class HardcoreRevive extends JavaPlugin { public class HardcoreRevive extends JavaPlugin {
DropHead dropHead;
@Override @Override
public void onEnable() { public void onEnable() {
this.getLogger().info("hardcore-revive plugin enabled"); this.getLogger().info("hardcore-revive plugin enabled");
this.getServer().getPluginManager().registerEvents(new PlayerDeathListener(this), this);
dropHead = new DropHead(this);
} }
} }