aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-06-15 18:58:57 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-06-15 18:58:57 -0600
commit9342bf9c0a1ae27fc6d1b4c886caf37e31708508 (patch)
tree7ce06479acd846be4d0db7cfbfc288816128b8a8
parentbbac7e1509c8fd526beb0585d6860aa7b3840f48 (diff)
downloadresurrection-9342bf9c0a1ae27fc6d1b4c886caf37e31708508.tar
resurrection-9342bf9c0a1ae27fc6d1b4c886caf37e31708508.tar.gz
resurrection-9342bf9c0a1ae27fc6d1b4c886caf37e31708508.tar.bz2
replaced thread with runnable
-rw-r--r--out/artifacts/Resurrection_jar/Resurrection.jarbin1338212 -> 1338621 bytes
-rw-r--r--out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener$1.classbin1346 -> 2165 bytes
-rw-r--r--out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener.classbin3994 -> 2911 bytes
-rw-r--r--out/production/Resurrection/net/brysonsteck/Resurrection/player/ResurrectPlayer.classbin1194 -> 421 bytes
-rw-r--r--src/net/brysonsteck/Resurrection/player/PlayerListener.java19
-rw-r--r--src/net/brysonsteck/Resurrection/player/ResurrectPlayer.java6
6 files changed, 13 insertions, 12 deletions
diff --git a/out/artifacts/Resurrection_jar/Resurrection.jar b/out/artifacts/Resurrection_jar/Resurrection.jar
index 2bfa11a..6246f78 100644
--- a/out/artifacts/Resurrection_jar/Resurrection.jar
+++ b/out/artifacts/Resurrection_jar/Resurrection.jar
Binary files differ
diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener$1.class b/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener$1.class
index 06c3631..4118186 100644
--- a/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener$1.class
+++ b/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener$1.class
Binary files differ
diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener.class b/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener.class
index 6eacb7f..a0d4416 100644
--- a/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener.class
+++ b/out/production/Resurrection/net/brysonsteck/Resurrection/player/PlayerListener.class
Binary files differ
diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection/player/ResurrectPlayer.class b/out/production/Resurrection/net/brysonsteck/Resurrection/player/ResurrectPlayer.class
index 7028b20..2ee2252 100644
--- a/out/production/Resurrection/net/brysonsteck/Resurrection/player/ResurrectPlayer.class
+++ b/out/production/Resurrection/net/brysonsteck/Resurrection/player/ResurrectPlayer.class
Binary files differ
diff --git a/src/net/brysonsteck/Resurrection/player/PlayerListener.java b/src/net/brysonsteck/Resurrection/player/PlayerListener.java
index 67a31db..6bc361f 100644
--- a/src/net/brysonsteck/Resurrection/player/PlayerListener.java
+++ b/src/net/brysonsteck/Resurrection/player/PlayerListener.java
@@ -1,6 +1,7 @@
package net.brysonsteck.Resurrection.player;
import net.brysonsteck.Resurrection.Resurrection;
+import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
@@ -33,16 +34,16 @@ public class PlayerListener implements Listener {
// String resurrectFormatted = resurrect.formatTime();
p.sendMessage("You have died!! You will be able to respawn in the next 24 hours.");
-
- new Thread (() -> {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException interruptedException) {
- interruptedException.printStackTrace();
- p.sendMessage("[Resurrection] An error has occurred! Please contact the admin. (Failed to make the thread sleep!)");
+
+ new BukkitRunnable() {
+ @Override
+ public void run() {
+ for (PotionEffect effect : p.getActivePotionEffects())
+ p.removePotionEffect(effect.getType());
+ p.setGameMode(GameMode.SURVIVAL);
+ Bukkit.broadcastMessage(p.getDisplayName() + " has been resurrected manually by an admin!");
}
- ResurrectPlayer resurrectPlayer = new ResurrectPlayer(p);
- }).start();
+ }.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), 200);
}
@EventHandler
diff --git a/src/net/brysonsteck/Resurrection/player/ResurrectPlayer.java b/src/net/brysonsteck/Resurrection/player/ResurrectPlayer.java
index 412387f..b9f2348 100644
--- a/src/net/brysonsteck/Resurrection/player/ResurrectPlayer.java
+++ b/src/net/brysonsteck/Resurrection/player/ResurrectPlayer.java
@@ -8,7 +8,7 @@ import org.bukkit.potion.PotionEffect;
public class ResurrectPlayer {
public ResurrectPlayer(Player p) {
- p.setGameMode(GameMode.SURVIVAL);
- Bukkit.broadcastMessage(p.getDisplayName() + " has resurrected!");
- }
+
+
+ }
}