This commit is contained in:
Luca
2021-11-22 19:02:40 +01:00
parent 91c766ddce
commit 5732128d14
20 changed files with 1071 additions and 32 deletions

View File

@ -37,7 +37,8 @@ public class RespawnRunnable extends BukkitRunnable {
}
if (this.respawnTime <= 1) {
this.playerData.setPlayerState(PlayerState.PLAYING);
this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> this.playerData.setPlayerState(PlayerState.PLAYING), 20L);
this.game.getTeams().forEach(team -> team.playingPlayers().forEach(gamePlayer -> gamePlayer.showPlayer(this.player)));
this.player.teleport(this.gameTeam.getId() == 1 ? this.game.getCopiedArena().getA().toBukkitLocation() : this.game.getCopiedArena().getB().toBukkitLocation());
@ -45,10 +46,10 @@ public class RespawnRunnable extends BukkitRunnable {
this.player.sendMessage(CC.translate("&aYou have respawned!"));
this.player.playSound(this.player.getLocation(), Sound.ORB_PICKUP, 10F, 1F);
this.player.getInventory().setArmorContents(this.plugin.getGameManager().getGameArmor(playerData));
for (ItemStack stack : this.plugin.getGameManager().getGameItems()) {
this.player.getInventory().addItem(stack);
}
this.player.getInventory().setArmorContents(this.plugin.getGameManager().getGameArmor(playerData));
this.game.getTeams().forEach(team -> team.playingPlayers().filter(player1 -> !this.player.equals(player1))
.forEach(matchplayer -> matchplayer.sendMessage(CC.translate(this.gameTeam.getPlayerTeam().getChatColor() + this.player.getName() + " &ehas respawned!"))));