diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java index ce75e6d..84719ba 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java @@ -35,7 +35,7 @@ public class GameEndListener implements Listener { playerData.setGameKills(0); String winnerTitle = CC.translate("&aVICTORY!"); - String losingTitle = CC.translate("&aDEFEAT!"); + String losingTitle = CC.translate("&cDEFEAT!"); String subTitle = CC.translate(winningTeam.getPlayerTeam().getChatColor() + winningTeam.getPlayerTeam().getName() + " &fhas won the game!"); if (winningTeam.getAllPlayers().contains(player.getUniqueId())) { diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java index 868466f..00d9498 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java @@ -34,6 +34,10 @@ public class MovementListener implements Listener { return; } + if (playerData.getPlayerState() == PlayerState.RESPAWNING) { + return; + } + if (!this.isInGame(playerData)) { return; } diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/PlayerKillListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/PlayerKillListener.java index 27e2f61..fbde619 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/PlayerKillListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/PlayerKillListener.java @@ -8,6 +8,7 @@ import rip.tilly.bedwars.events.PlayerKillEvent; import rip.tilly.bedwars.game.Game; import rip.tilly.bedwars.game.GameTeam; import rip.tilly.bedwars.playerdata.PlayerData; +import rip.tilly.bedwars.playerdata.PlayerState; import rip.tilly.bedwars.runnables.RespawnRunnable; public class PlayerKillListener implements Listener { @@ -32,6 +33,7 @@ public class PlayerKillListener implements Listener { GameTeam playerTeam = game.getTeams().get(playerData.getTeamId()); if (playerTeam.isHasBed()) { + playerData.setPlayerState(PlayerState.RESPAWNING); if (killer != null) { PlayerData killerData = this.plugin.getPlayerDataManager().getPlayerData(killer.getUniqueId()); game.broadcast(playerData.getPlayerTeam().getChatColor() + player.getName() + " &ewas killed by " + killerData.getPlayerTeam().getChatColor() + killer.getName() + "&e!"); diff --git a/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java b/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java index afc3a80..4505c67 100644 --- a/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java +++ b/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java @@ -52,6 +52,9 @@ public class RespawnRunnable extends BukkitRunnable { this.player.setFoodLevel(20); this.playerData.setLastDamager(null); + this.player.setAllowFlight(false); + this.player.setFlying(false); + cancel(); return; }