aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-06-06 17:48:46 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-06-06 17:48:46 -0600
commit0f89320996551ca6b5584be55b230f0511a5ad2c (patch)
tree8baef46923150692a2147823753cea5bccfb5185 /src/net/brysonsteck/Resurrection
parent65033eee492e0016f88de2d765701bdb854ce330 (diff)
downloadresurrection-0f89320996551ca6b5584be55b230f0511a5ad2c.tar
resurrection-0f89320996551ca6b5584be55b230f0511a5ad2c.tar.gz
resurrection-0f89320996551ca6b5584be55b230f0511a5ad2c.tar.bz2
finishing the appearance of being dead
Diffstat (limited to 'src/net/brysonsteck/Resurrection')
-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