|
@@ -241,15 +241,21 @@ public class GameListener extends GameBoundListener {
|
|
if (!isInGameWorld(e.getPlayer().getLocation()))
|
|
if (!isInGameWorld(e.getPlayer().getLocation()))
|
|
return;
|
|
return;
|
|
|
|
|
|
- Team t = Objects.requireNonNull(getGame().getPlayer(e.getPlayer())).getTeam();
|
|
|
|
|
|
+ Game game = getGame();
|
|
|
|
+ Player player = e.getPlayer();
|
|
|
|
+
|
|
|
|
+ Team t = Objects.requireNonNull(getGame().getPlayer(player)).getTeam();
|
|
if (t != null) {
|
|
if (t != null) {
|
|
e.setRespawnLocation(t.getSpawn());
|
|
e.setRespawnLocation(t.getSpawn());
|
|
FallProtectionConfiguration fallProtection = getGame().getArena().getFallProtection();
|
|
FallProtectionConfiguration fallProtection = getGame().getArena().getFallProtection();
|
|
if (fallProtection.isEnabled())
|
|
if (fallProtection.isEnabled())
|
|
- new RespawnGoldBlock(e.getPlayer(), fallProtection.getDuration(), fallProtection.isMessageOnlyOnStart(), getGame());
|
|
|
|
|
|
+ new RespawnGoldBlock(player, fallProtection.getDuration(), fallProtection.isMessageOnlyOnStart(), getGame());
|
|
} else {
|
|
} else {
|
|
e.setRespawnLocation(getGame().getArena().getSpectatorSpawn());
|
|
e.setRespawnLocation(getGame().getArena().getSpectatorSpawn());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ game.sendGameItems(player, true);
|
|
|
|
+ game.setPlayerAttributes(player);
|
|
}
|
|
}
|
|
|
|
|
|
@EventHandler
|
|
@EventHandler
|
|
@@ -279,9 +285,6 @@ public class GameListener extends GameBoundListener {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- game.sendGameItems(p, true);
|
|
|
|
- game.setPlayerAttributes(p);
|
|
|
|
-
|
|
|
|
// check the death cause for choice the death message
|
|
// check the death cause for choice the death message
|
|
if (p.getLastDamageCause() != null) {
|
|
if (p.getLastDamageCause() != null) {
|
|
|
|
|