From f16c8d1dcd3827e20425a46edd7ad7d1e22e99f7 Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sat, 13 Apr 2019 22:54:54 +0200 Subject: [PATCH] hotfixes Signed-off-by: Yaruma3341 --- .../listener/PlayerJoinListener.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java b/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java index 9342eb1..4b46c68 100644 --- a/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java +++ b/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java @@ -60,15 +60,38 @@ public class PlayerJoinListener implements Listener { player.setGameMode(GameMode.ADVENTURE); player.spigot().sendMessage(publicList); player.spigot().sendMessage(privateList); + player.teleport(Config.TeamRedSpawn); + SetupItems.giveSetupItems(player); } else if(!Fight.getBlueTeam().hasTeamLeader()) { Fight.getBlueTeam().setLeader(new FightPlayer(player, false)); player.setGameMode(GameMode.ADVENTURE); player.spigot().sendMessage(publicList); player.spigot().sendMessage(privateList); + player.teleport(Config.TeamBlueSpawn); + SetupItems.giveSetupItems(player); } else { player.setGameMode(GameMode.SPECTATOR); player.teleport(Config.SpecSpawn); } + } else { + FightPlayer fightPlayer = fightTeam.getFightPlayer(player); + + if(instance.getFightState() == FightState.SETUP) { + if(fightTeam == Fight.redTeam) { + player.teleport(Config.TeamRedSpawn); + } else + player.teleport(Config.TeamBlueSpawn); + + player.setGameMode(GameMode.ADVENTURE); + Countdown.cancelTimerType(CountdownType.NO_PLAYERS_ONLINE); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§aDer Spieler §6" + fightPlayer.getPlayer().getName() + " §aist dem Kampf beigetreten!"); + } else { + player.setGameMode(GameMode.SPECTATOR); + if(fightTeam == Fight.redTeam) + player.teleport(Config.TeamRedSpawn); + else + player.teleport(Config.TeamBlueSpawn); + } } if(Fight.getRedTeam().hasTeamLeader() && Fight.getBlueTeam().hasTeamLeader()) {