From c81a454f4319f4da39abf83f037965db484904f2 Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sat, 23 Feb 2019 20:35:30 +0100 Subject: [PATCH] Not stable version Signed-off-by: Yaruma3341 --- .../listener/EntityDamageByEntityListener.java | 3 +++ .../fightsystem/listener/PlayerJoinListener.java | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/me/yaruma/fightsystem/listener/EntityDamageByEntityListener.java b/src/me/yaruma/fightsystem/listener/EntityDamageByEntityListener.java index 4ce2b59..92dbb8f 100644 --- a/src/me/yaruma/fightsystem/listener/EntityDamageByEntityListener.java +++ b/src/me/yaruma/fightsystem/listener/EntityDamageByEntityListener.java @@ -22,6 +22,9 @@ public class EntityDamageByEntityListener implements Listener { if(event.getEntity() instanceof Player) { event.setCancelled(true); } + if(event.getDamager() instanceof TNTPrimed) { + event.setCancelled(true); + } } else { if(event.getEntity() instanceof Player) { Player player = ((Player) event.getEntity()).getPlayer(); diff --git a/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java b/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java index 11fb11a..ce99120 100644 --- a/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java +++ b/src/me/yaruma/fightsystem/listener/PlayerJoinListener.java @@ -33,14 +33,11 @@ public class PlayerJoinListener implements Listener { if(!Fight.getRedTeam().hasTeamLeader()) { Fight.getRedTeam().setLeader(new FightPlayer(player, false)); player.setGameMode(GameMode.ADVENTURE); - Bukkit.broadcastMessage("ADVENTURE 36"); } else if(!Fight.getBlueTeam().hasTeamLeader()) { Fight.getBlueTeam().setLeader(new FightPlayer(player, false)); player.setGameMode(GameMode.ADVENTURE); - Bukkit.broadcastMessage("ADVENTURE 39"); } else { player.setGameMode(GameMode.SPECTATOR); - Bukkit.broadcastMessage("SPECTATOR 42"); player.teleport(instance.getSpecSpawnLoc()); } } @@ -58,8 +55,11 @@ public class PlayerJoinListener implements Listener { player.setGameMode(GameMode.ADVENTURE); if(fightPlayer.isLeader()) SetupItems.giveSetupItems(player); - fightPlayer.setOut(false); - Bukkit.broadcastMessage(FightSystem.PREFIX + "§aDer Spieler §6" + fightPlayer.getPlayer().getName() + " §aist dem Kampf wieder beigetreten!"); + if(fightPlayer.isOut()) { + fightPlayer.setOut(false); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§aDer Spieler §6" + fightPlayer.getPlayer().getName() + " §aist dem Kampf wieder beigetreten!"); + } else + Bukkit.broadcastMessage(FightSystem.PREFIX + "§aDer Spieler §6" + fightPlayer.getPlayer().getName() + " §aist dem Kampf beigetreten!"); } else { player.setGameMode(GameMode.SPECTATOR); if(fightTeam == Fight.redTeam)