aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/brysonsteck')
-rw-r--r--src/net/brysonsteck/Resurrection/player/PlayerListener.java19
-rw-r--r--src/net/brysonsteck/Resurrection/player/ResurrectPlayer.java6
2 files changed, 13 insertions, 12 deletions
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!");
- }
+
+
+ }
}