diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/Skywars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/Skywars.java index 705ee46a1..8a3dec9c4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/Skywars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/Skywars.java @@ -83,11 +83,13 @@ import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.LeavesDecayEvent; import org.bukkit.event.entity.EntityCombustEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityTargetLivingEntityEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.ItemDespawnEvent; +import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; @@ -962,6 +964,9 @@ public abstract class Skywars extends Game if (event.GetDamage() >= 1) return; + if(GetTeam(event.GetDamagerPlayer(true)) == GetTeam(event.GetDamageePlayer())) + return; + if (event.GetProjectile() instanceof Egg || event.GetProjectile() instanceof Snowball) { event.SetCancelled("Egg/Snowball"); @@ -982,6 +987,25 @@ public abstract class Skywars extends Game event.GetDamageeEntity().setVelocity(vel); } } + + @EventHandler + public void projectile(EntityDamageByEntityEvent event) + { + if(event.getDamager() instanceof Snowball || event.getDamager() instanceof Egg || event.getDamager() instanceof EnderPearl) + { + Projectile prj = (Projectile) event.getDamager(); + if(prj.getShooter() instanceof Player) + { + if(event.getEntity() instanceof Player) + { + if(GetTeam((Player) prj.getShooter()) == GetTeam((Player) event.getEntity())) + { + event.setCancelled(true); + } + } + } + } + } private void fillChest(Player looter, Block block) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/TeamSkywars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/TeamSkywars.java index 53c7148cf..d93324d33 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/TeamSkywars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/TeamSkywars.java @@ -134,7 +134,7 @@ public class TeamSkywars extends Skywars private enum TeamColors { - YELLOW(ChatColor.YELLOW, new String[]{"Bananna", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}), + YELLOW(ChatColor.YELLOW, new String[]{"Banana", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}), GREEN(ChatColor.GREEN, new String[]{"Creepers", "Alien", "Seaweed", "Emerald", "Grinch", "Shrub", "Snake", "Leaf"}), AQUA(ChatColor.AQUA, new String[]{"Diamond", "Ice", "Pool", "Kraken", "Aquatic", "Ocean"}), RED(ChatColor.RED, new String[]{"Heart", "Tomato", "Ruby", "Jam", "Rose", "Apple", "TNT"}), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/TeamSuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/TeamSuperSmash.java index 6aa1dbcef..6065d2f60 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/TeamSuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/TeamSuperSmash.java @@ -153,7 +153,7 @@ public class TeamSuperSmash extends SuperSmash private enum TeamColors { - YELLOW(ChatColor.YELLOW, new String[]{"Bananna", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}), + YELLOW(ChatColor.YELLOW, new String[]{"Banana", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}), GREEN(ChatColor.GREEN, new String[]{"Creepers", "Alien", "Seaweed", "Emerald", "Grinch", "Shrub", "Snake", "Leaf"}), AQUA(ChatColor.AQUA, new String[]{"Diamond", "Ice", "Pool", "Kraken", "Aquatic", "Ocean"}), RED(ChatColor.RED, new String[]{"Heart", "Tomato", "Ruby", "Jam", "Rose", "Apple", "TNT"}), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java index 75aede149..81854bdae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java @@ -106,7 +106,7 @@ public class TeamSurvivalGames extends SurvivalGames private enum TeamColors { - YELLOW(ChatColor.YELLOW, new String[]{"Bananna", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}), + YELLOW(ChatColor.YELLOW, new String[]{"Banana", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}), GREEN(ChatColor.GREEN, new String[]{"Creepers", "Alien", "Seaweed", "Emerald", "Grinch", "Shrub", "Snake", "Leaf"}), AQUA(ChatColor.AQUA, new String[]{"Diamond", "Ice", "Pool", "Kraken", "Aquatic", "Ocean"}), RED(ChatColor.RED, new String[]{"Heart", "Tomato", "Ruby", "Jam", "Rose", "Apple", "TNT"}), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java index e3d65cd81..ce4603693 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java @@ -131,7 +131,10 @@ public class PerkNeedler extends SmashPerk DamageCause.THORNS, 1.1, true, true, false, damager.getName(), GetName()); - Manager.GetCondition().Factory().Poison(GetName(), event.GetDamageeEntity(), damager, 2, 0, false, false, false); + if(Manager.GetGame().GetTeam(event.GetDamageePlayer()) != Manager.GetGame().GetTeam(damager)) + { + Manager.GetCondition().Factory().Poison(GetName(), event.GetDamageeEntity(), damager, 2, 0, false, false, false); + } } @EventHandler