From e05c16e0a649356020dc1b05d38c4a73e709ce00 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 5 Jun 2021 23:10:04 -0600 Subject: initial commit --- .idea/.gitignore | 3 + .idea/.name | 1 + .idea/description.html | 1 + .idea/encodings.xml | 7 ++ .../spigot_api_1_16_5_R0_1_20210524_223338_87.xml | 9 ++ .idea/misc.xml | 12 ++ .idea/modules.xml | 8 ++ .idea/project-template.xml | 3 + .idea/uiDesigner.xml | 124 +++++++++++++++++++++ Resurrection.iml | 12 ++ data/player.data | 1 + lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar | Bin 0 -> 1307220 bytes .../DeadForADay/net/brysonsteck/DeadForADay.class | Bin 0 -> 1840 bytes .../DeadForADay/net/brysonsteck/PlayerData.class | Bin 0 -> 1749 bytes .../DeadForADay/net/brysonsteck/plugin.yml | 0 .../Resurrection/net/brysonsteck/PlayerData.class | Bin 0 -> 2006 bytes .../net/brysonsteck/Resurrection.class | Bin 0 -> 818 bytes .../Resurrection/net/brysonsteck/plugin.yml | 0 src/net/brysonsteck/PlayerAttributes.java | 24 ++++ src/net/brysonsteck/PlayerData.java | 46 ++++++++ src/net/brysonsteck/Resurrection.java | 44 ++++++++ src/net/brysonsteck/plugin.yml | 0 22 files changed, 295 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/description.html create mode 100644 .idea/encodings.xml create mode 100644 .idea/libraries/spigot_api_1_16_5_R0_1_20210524_223338_87.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/project-template.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 Resurrection.iml create mode 100644 data/player.data create mode 100644 lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar create mode 100644 out/production/DeadForADay/net/brysonsteck/DeadForADay.class create mode 100644 out/production/DeadForADay/net/brysonsteck/PlayerData.class create mode 100644 out/production/DeadForADay/net/brysonsteck/plugin.yml create mode 100644 out/production/Resurrection/net/brysonsteck/PlayerData.class create mode 100644 out/production/Resurrection/net/brysonsteck/Resurrection.class create mode 100644 out/production/Resurrection/net/brysonsteck/plugin.yml create mode 100644 src/net/brysonsteck/PlayerAttributes.java create mode 100644 src/net/brysonsteck/PlayerData.java create mode 100644 src/net/brysonsteck/Resurrection.java create mode 100644 src/net/brysonsteck/plugin.yml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..d956a6b --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Resurrection \ No newline at end of file diff --git a/.idea/description.html b/.idea/description.html new file mode 100644 index 0000000..db5f129 --- /dev/null +++ b/.idea/description.html @@ -0,0 +1 @@ +Simple Java application that includes a class with main() method \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..7b0d571 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/spigot_api_1_16_5_R0_1_20210524_223338_87.xml b/.idea/libraries/spigot_api_1_16_5_R0_1_20210524_223338_87.xml new file mode 100644 index 0000000..7b4affa --- /dev/null +++ b/.idea/libraries/spigot_api_1_16_5_R0_1_20210524_223338_87.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..cf79644 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ad84213 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/project-template.xml b/.idea/project-template.xml new file mode 100644 index 0000000..1f08b88 --- /dev/null +++ b/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resurrection.iml b/Resurrection.iml new file mode 100644 index 0000000..e940e50 --- /dev/null +++ b/Resurrection.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/data/player.data b/data/player.data new file mode 100644 index 0000000..d5d4ef7 --- /dev/null +++ b/data/player.data @@ -0,0 +1 @@ +username,false,0 \ No newline at end of file diff --git a/lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar b/lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar new file mode 100644 index 0000000..75fba07 Binary files /dev/null and b/lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar differ diff --git a/out/production/DeadForADay/net/brysonsteck/DeadForADay.class b/out/production/DeadForADay/net/brysonsteck/DeadForADay.class new file mode 100644 index 0000000..6fe8bca Binary files /dev/null and b/out/production/DeadForADay/net/brysonsteck/DeadForADay.class differ diff --git a/out/production/DeadForADay/net/brysonsteck/PlayerData.class b/out/production/DeadForADay/net/brysonsteck/PlayerData.class new file mode 100644 index 0000000..978e898 Binary files /dev/null and b/out/production/DeadForADay/net/brysonsteck/PlayerData.class differ diff --git a/out/production/DeadForADay/net/brysonsteck/plugin.yml b/out/production/DeadForADay/net/brysonsteck/plugin.yml new file mode 100644 index 0000000..e69de29 diff --git a/out/production/Resurrection/net/brysonsteck/PlayerData.class b/out/production/Resurrection/net/brysonsteck/PlayerData.class new file mode 100644 index 0000000..3b9818b Binary files /dev/null and b/out/production/Resurrection/net/brysonsteck/PlayerData.class differ diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection.class b/out/production/Resurrection/net/brysonsteck/Resurrection.class new file mode 100644 index 0000000..2adf2d9 Binary files /dev/null and b/out/production/Resurrection/net/brysonsteck/Resurrection.class differ diff --git a/out/production/Resurrection/net/brysonsteck/plugin.yml b/out/production/Resurrection/net/brysonsteck/plugin.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/net/brysonsteck/PlayerAttributes.java b/src/net/brysonsteck/PlayerAttributes.java new file mode 100644 index 0000000..de8edcc --- /dev/null +++ b/src/net/brysonsteck/PlayerAttributes.java @@ -0,0 +1,24 @@ +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/PlayerData.java b/src/net/brysonsteck/PlayerData.java new file mode 100644 index 0000000..556c147 --- /dev/null +++ b/src/net/brysonsteck/PlayerData.java @@ -0,0 +1,46 @@ +package net.brysonsteck; + +import java.io.*; +import java.util.Arrays; +import java.util.Hashtable; + +public class PlayerData { + Hashtable> playerData = new Hashtable<>(); + + public void saveData(String write) { + try { + FileWriter writer = new FileWriter("data/player.data"); + writer.write(write); + writer.close(); + readData(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void readData() { + try { + BufferedReader reader = new BufferedReader(new FileReader("data/player.data")); + String line = ""; + String[] playerData; + while (true) { + playerData = new String[3]; + line = reader.readLine(); + if (line == null) { + break; + } + playerData = line.split(","); + Hashtable playerHash = new Hashtable<>(); + playerHash.put("dead", playerData[1]); + playerHash.put("timeLeft", playerData[2]); + this.playerData.put(playerData[0], playerHash); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + public Hashtable> getPlayers() { + return playerData; + } +} diff --git a/src/net/brysonsteck/Resurrection.java b/src/net/brysonsteck/Resurrection.java new file mode 100644 index 0000000..c4553e8 --- /dev/null +++ b/src/net/brysonsteck/Resurrection.java @@ -0,0 +1,44 @@ +package net.brysonsteck; + +import org.bukkit.event.player.PlayerRespawnEvent; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.JavaPlugin; + +import java.io.*; +import java.nio.Buffer; + +public class Resurrection extends JavaPlugin { + public Plugin plugin = getPlugin(Resurrection.class); + + //spigot things + @Override + public void onDisable() { + super.onDisable(); + } + + @Override + public void onEnable() { + super.onEnable(); + + } + + // end of spigot things + public static void main(String[] args) { +// PlayerData playerData = new PlayerData(); +// playerData.saveData("This is the first line\nthis is the second line"); +// System.out.println(playerData.getPlayers()); +// playerData.readData(); + +// playerData.saveData("username,false,0"); +// System.out.println("now adding two more lines"); +// playerData.saveData(playerData.getPlayers() + "this is the third line\nthis is the fourth line\nthe thread is now sleeping\nonce more\nand again"); +// System.out.println(playerData.getPlayers()); +// try { +// Thread.sleep(100000); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + + } + +} diff --git a/src/net/brysonsteck/plugin.yml b/src/net/brysonsteck/plugin.yml new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3