This commit is contained in:
Luca 2021-11-22 16:11:10 +01:00
parent 16213e44d0
commit abaa4828dc
4 changed files with 10 additions and 1 deletions

View File

@ -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())) {

View File

@ -34,6 +34,10 @@ public class MovementListener implements Listener {
return;
}
if (playerData.getPlayerState() == PlayerState.RESPAWNING) {
return;
}
if (!this.isInGame(playerData)) {
return;
}

View File

@ -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!");

View File

@ -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;
}