changed to adventure gamemode

This commit is contained in:
Bryson Steck 2021-06-06 12:41:43 -06:00
parent 1922bb3499
commit c1981178a4
5 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ public class PlayerListener implements Listener {
public void onDeath(PlayerDeathEvent e) { public void onDeath(PlayerDeathEvent e) {
System.out.println("Resurrection: A player has died!"); System.out.println("Resurrection: A player has died!");
Player p = e.getEntity(); Player p = e.getEntity();
p.setGameMode(GameMode.SPECTATOR); p.setGameMode(GameMode.ADVENTURE);
Long timeOfDeath = System.currentTimeMillis(); Long timeOfDeath = System.currentTimeMillis();
Long resurrectionTime = timeOfDeath + 86400000; Long resurrectionTime = timeOfDeath + 86400000;

View file

@ -22,7 +22,7 @@ public class CommandResurrect implements CommandExecutor {
p.sendMessage("That player does not exist! Failed to resurrect."); p.sendMessage("That player does not exist! Failed to resurrect.");
return false; return false;
} }
if (resurrectPlayer.getGameMode() == GameMode.SPECTATOR) { if (resurrectPlayer.getGameMode() == GameMode.ADVENTURE) {
for (PotionEffect effect : resurrectPlayer.getActivePotionEffects()) for (PotionEffect effect : resurrectPlayer.getActivePotionEffects())
resurrectPlayer.removePotionEffect(effect.getType()); resurrectPlayer.removePotionEffect(effect.getType());
resurrectPlayer.setGameMode(GameMode.SURVIVAL); resurrectPlayer.setGameMode(GameMode.SURVIVAL);
@ -44,7 +44,7 @@ public class CommandResurrect implements CommandExecutor {
System.out.println("That player does not exist! Failed to resurrect."); System.out.println("That player does not exist! Failed to resurrect.");
return false; return false;
} }
if (resurrectPlayer.getGameMode() == GameMode.SPECTATOR) { if (resurrectPlayer.getGameMode() == GameMode.ADVENTURE) {
for (PotionEffect effect : resurrectPlayer.getActivePotionEffects()) for (PotionEffect effect : resurrectPlayer.getActivePotionEffects())
resurrectPlayer.removePotionEffect(effect.getType()); resurrectPlayer.removePotionEffect(effect.getType());
resurrectPlayer.setGameMode(GameMode.SURVIVAL); resurrectPlayer.setGameMode(GameMode.SURVIVAL);