aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-06-06 11:06:51 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-06-06 11:06:51 -0600
commita6193c66185c069db9a8f9f7a7aca570ae55994b (patch)
tree0f06ecf0ce524e26b9fa6e7e51d405b3f7dcc07a /src
parent18605537f1bb7cd84f4131a9c42002a6973a592c (diff)
downloadresurrection-a6193c66185c069db9a8f9f7a7aca570ae55994b.tar
resurrection-a6193c66185c069db9a8f9f7a7aca570ae55994b.tar.gz
resurrection-a6193c66185c069db9a8f9f7a7aca570ae55994b.tar.bz2
added a register in resurrection class
Diffstat (limited to 'src')
-rw-r--r--src/net/brysonsteck/PlayerAttributes.java24
-rw-r--r--src/net/brysonsteck/PlayerListener.java1
-rw-r--r--src/net/brysonsteck/Resurrection.java1
3 files changed, 2 insertions, 24 deletions
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();
}