changed to adventure gamemode
This commit is contained in:
parent
1922bb3499
commit
c1981178a4
5 changed files with 3 additions and 3 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue