aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/brysonsteck')
-rw-r--r--src/net/brysonsteck/Resurrection/PlayerListener.java12
-rw-r--r--src/net/brysonsteck/Resurrection/TimeCheck.java (renamed from src/net/brysonsteck/Resurrection/TImeCheck.java)0
2 files changed, 4 insertions, 8 deletions
diff --git a/src/net/brysonsteck/Resurrection/PlayerListener.java b/src/net/brysonsteck/Resurrection/PlayerListener.java
index 0582356..f0c5d6e 100644
--- a/src/net/brysonsteck/Resurrection/PlayerListener.java
+++ b/src/net/brysonsteck/Resurrection/PlayerListener.java
@@ -17,7 +17,7 @@ public class PlayerListener implements Listener {
public void onDeath(PlayerDeathEvent e) {
System.out.println("Resurrection: A player has died!");
Player p = e.getEntity();
- p.setGameMode(GameMode.ADVENTURE);
+ p.setGameMode(GameMode.SPECTATOR);
Long timeOfDeath = System.currentTimeMillis();
Long resurrectionTime = timeOfDeath + 86400000;
@@ -27,25 +27,21 @@ public class PlayerListener implements Listener {
String deathFormatted = death.formatTime();
String resurrectFormatted = resurrect.formatTime();
-
- p.sendMessage("You have died! You will be able to respawn in 24 hours.");
+ p.sendMessage("You have died!! You will be able to respawn in the next " + resurrectFormatted);
}
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent e) {
Player p = e.getPlayer();
- p.sendMessage("You have respawned");
- p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,500000, 500));
- p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 500000, 500));
+ p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 86400, 255));
}
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
Player p = e.getPlayer();
Location location = p.getLocation();
- if (p.getGameMode() == GameMode.SPECTATOR) {
+ if (p.getGameMode() == GameMode.SPECTATOR && p.hasPotionEffect(PotionEffectType.BLINDNESS)) {
p.teleport(location);
}
-
}
}
diff --git a/src/net/brysonsteck/Resurrection/TImeCheck.java b/src/net/brysonsteck/Resurrection/TimeCheck.java
index a7ea06c..a7ea06c 100644
--- a/src/net/brysonsteck/Resurrection/TImeCheck.java
+++ b/src/net/brysonsteck/Resurrection/TimeCheck.java