From a6193c66185c069db9a8f9f7a7aca570ae55994b Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 6 Jun 2021 11:06:51 -0600 Subject: added a register in resurrection class --- out/artifacts/Resurrection_jar/Resurrection.jar | Bin 1330141 -> 1329091 bytes .../net/brysonsteck/PlayerAttributes.class | Bin 2079 -> 0 bytes .../net/brysonsteck/PlayerListener.class | Bin 1714 -> 1714 bytes .../net/brysonsteck/Resurrection.class | Bin 889 -> 1174 bytes src/net/brysonsteck/PlayerAttributes.java | 24 --------------------- src/net/brysonsteck/PlayerListener.java | 1 + src/net/brysonsteck/Resurrection.java | 1 + 7 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 out/production/Resurrection/net/brysonsteck/PlayerAttributes.class delete mode 100644 src/net/brysonsteck/PlayerAttributes.java diff --git a/out/artifacts/Resurrection_jar/Resurrection.jar b/out/artifacts/Resurrection_jar/Resurrection.jar index ac3007d..93b53ec 100644 Binary files a/out/artifacts/Resurrection_jar/Resurrection.jar and b/out/artifacts/Resurrection_jar/Resurrection.jar differ diff --git a/out/production/Resurrection/net/brysonsteck/PlayerAttributes.class b/out/production/Resurrection/net/brysonsteck/PlayerAttributes.class deleted file mode 100644 index 831949d..0000000 Binary files a/out/production/Resurrection/net/brysonsteck/PlayerAttributes.class and /dev/null differ diff --git a/out/production/Resurrection/net/brysonsteck/PlayerListener.class b/out/production/Resurrection/net/brysonsteck/PlayerListener.class index e4cf33b..fee49cd 100644 Binary files a/out/production/Resurrection/net/brysonsteck/PlayerListener.class and b/out/production/Resurrection/net/brysonsteck/PlayerListener.class differ diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection.class b/out/production/Resurrection/net/brysonsteck/Resurrection.class index 9b8a988..aa75e79 100644 Binary files a/out/production/Resurrection/net/brysonsteck/Resurrection.class and b/out/production/Resurrection/net/brysonsteck/Resurrection.class differ diff --git a/src/net/brysonsteck/PlayerAttributes.java b/src/net/brysonsteck/PlayerAttributes.java deleted file mode 100644 index de8edcc..0000000 --- a/src/net/brysonsteck/PlayerAttributes.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.brysonsteck; - -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.plugin.Plugin; - -public class PlayerAttributes implements Listener { - public Plugin plugin = Resurrection.getPlugin(Resurrection.class); - - public void onDeath(PlayerDeathEvent event) { - Player p = event.getEntity(); - Player k = event.getEntity().getKiller(); - int killcount = plugin.getConfig().getInt("Users." + k.getUniqueId().toString() + ".Kills") ; - int deathcount = plugin.getConfig().getInt("Users." + p.getUniqueId().toString() + ".Deaths") ; - - plugin.getConfig().set("Users." + p.getUniqueId().toString() + ".Deaths", deathcount + 1); - plugin.getConfig().set("Users." + k.getUniqueId().toString() + ".Kills", killcount + 1); - plugin.saveConfig(); - - - } -} \ No newline at end of file diff --git a/src/net/brysonsteck/PlayerListener.java b/src/net/brysonsteck/PlayerListener.java index c9a175c..a586d31 100644 --- a/src/net/brysonsteck/PlayerListener.java +++ b/src/net/brysonsteck/PlayerListener.java @@ -4,6 +4,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.plugin.java.JavaPlugin; public class PlayerListener implements Listener { @EventHandler diff --git a/src/net/brysonsteck/Resurrection.java b/src/net/brysonsteck/Resurrection.java index 25008b8..d0925cd 100644 --- a/src/net/brysonsteck/Resurrection.java +++ b/src/net/brysonsteck/Resurrection.java @@ -19,6 +19,7 @@ public class Resurrection extends JavaPlugin { @Override public void onEnable() { super.onEnable(); + this.getServer().getPluginManager().registerEvents(new PlayerListener(), this); System.out.println("Resurrection: I'm alive!"); PlayerListener playerListener = new PlayerListener(); } -- cgit v1.2.3