diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssault.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssault.java index c1d2a7f0e..4df26278e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssault.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssault.java @@ -820,7 +820,7 @@ public class CastleAssault extends TeamGame @SuppressWarnings("deprecation") @EventHandler(ignoreCancelled=true) - public void onPlayerEmptyBucket(PlayerBucketFillEvent event) + public void onPlayerFillBucket(PlayerBucketFillEvent event) { if (!IsLive()) { @@ -828,10 +828,10 @@ public class CastleAssault extends TeamGame } Player player = event.getPlayer(); - if (player.getItemInHand().getType() == Material.LAVA_BUCKET) + Block block = event.getBlockClicked().getRelative(event.getBlockFace()); + if (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) { event.setCancelled(true); - Block block = event.getBlockClicked().getRelative(event.getBlockFace()); player.sendBlockChange(block.getLocation(), block.getType(), block.getData()); } } @@ -1117,6 +1117,11 @@ public class CastleAssault extends TeamGame { return; } + if (Manager.GetLobby().getKits().containsKey(event.getEntity())) + { + event.setCancelled(true); + return; + } if (event.getEntity() instanceof EnderCrystal) { event.setCancelled(true); @@ -1127,6 +1132,10 @@ public class CastleAssault extends TeamGame event.setCancelled(true); if (event instanceof EntityDamageByEntityEvent) { + if (!event.getEntity().getCustomName().contains("Ryan") && !event.getEntity().getCustomName().contains("Jon")) + { + return; + } GameTeam owner = event.getEntity().getCustomName().contains("Ryan") ? GetTeam(ChatColor.AQUA) : GetTeam(ChatColor.RED); EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event; if (e.getDamager() instanceof Player) @@ -1353,6 +1362,11 @@ public class CastleAssault extends TeamGame { return; } + + Bukkit.getOnlinePlayers().forEach(player -> + { + player.getInventory().remove(_wearableTnt.build()); + }); Iterator tntIterator = _tntCarry.iterator(); @@ -1406,6 +1420,10 @@ public class CastleAssault extends TeamGame UtilTextBottom.display(GetTeam(player).GetColor() + player.getName() + " has the TNT!", UtilServer.getPlayers()); UtilFirework.playFirework(player.getEyeLocation(), Type.BURST, Color.RED, false, false); + if (player.getInventory().getHelmet() == null || player.getInventory().getHelmet().getType() != Material.TNT) + { + player.getInventory().setHelmet(_wearableTnt.build()); + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssaultTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssaultTDM.java index e9bfa88d6..e83f12804 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssaultTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castleassault/CastleAssaultTDM.java @@ -29,6 +29,7 @@ import org.bukkit.event.block.BlockFadeEvent; import org.bukkit.event.block.BlockFormEvent; import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.LeavesDecayEvent; +import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.ProjectileHitEvent; @@ -307,16 +308,14 @@ public class CastleAssaultTDM extends TeamGame GameTeam blue = GetTeam(ChatColor.AQUA); _teamKills.put(blue, 0); this.CreatureAllowOverride = true; - int kitIndex = 0; - for (int i = 0; i < WorldData.GetDataLocs("WHITE").size(); i++) + for (Kit kit : GetKits()) { - if (kitIndex >= GetKits().length) + List spawns = WorldData.GetCustomLocs(kit.GetName().toUpperCase()); + for (Location spawn : spawns) { - kitIndex = 0; + Entity ent = kit.SpawnEntity(spawn); + Manager.GetLobby().addKitLocation(ent, kit, spawn); } - Entity ent = GetKits()[kitIndex].SpawnEntity(WorldData.GetDataLocs("WHITE").get(i)); - Manager.GetLobby().addKitLocation(ent, GetKits()[kitIndex], WorldData.GetDataLocs("WHITE").get(i)); - kitIndex++; } this.CreatureAllowOverride = false; } @@ -711,18 +710,18 @@ public class CastleAssaultTDM extends TeamGame @SuppressWarnings("deprecation") @EventHandler(ignoreCancelled=true) - public void onPlayerEmptyBucket(PlayerBucketFillEvent event) + public void onPlayerFillBucket(PlayerBucketFillEvent event) { if (!IsLive()) { return; } - + Player player = event.getPlayer(); - if (player.getItemInHand().getType() == Material.LAVA_BUCKET) + Block block = event.getBlockClicked().getRelative(event.getBlockFace()); + if (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) { event.setCancelled(true); - Block block = event.getBlockClicked().getRelative(event.getBlockFace()); player.sendBlockChange(block.getLocation(), block.getType(), block.getData()); } } @@ -1068,4 +1067,18 @@ public class CastleAssaultTDM extends TeamGame _streakData.getOrDefault(player, new KillStreakData()).reset(); } + + @EventHandler(ignoreCancelled = true) + public void onDamage(EntityDamageEvent event) + { + if (!IsLive()) + { + return; + } + if (Manager.GetLobby().getKits().containsKey(event.getEntity())) + { + event.setCancelled(true); + return; + } + } } \ No newline at end of file