From f6d882fcb4cf7747c3a661ee0cceacb017229d0d Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 30 Jun 2016 19:44:36 -0400 Subject: [PATCH] Disallow placing throwing tnt --- .../src/nautilus/game/arcade/kit/perks/PerkBomber.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBomber.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBomber.java index 95ca01a94..98bb50f9d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBomber.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBomber.java @@ -127,6 +127,15 @@ public class PerkBomber extends Perk UtilPlayer.message(event.getPlayer(), F.main(GetName(), "You cannot drop " + F.item("Throwing TNT") + ".")); } + @EventHandler (ignoreCancelled = true) + public void on(BlockPlaceEvent event) + { + if (!isThrowingTnt(event.getItemInHand())) + return; + event.setCancelled(true); + UtilPlayer.message(event.getPlayer(), F.main(GetName(), "You cannot place " + F.item("Throwing TNT") + ".")); + } + @EventHandler public void TNTDeathRemove(PlayerDeathEvent event) { @@ -139,6 +148,7 @@ public class PerkBomber extends Perk int oldAmount = _tntCount.get(event.getEntity()).get(); if (oldAmount < remove.size()) { + // fixme If you die with someone else's tnt, then this will occur System.out.println("Strange.... expected " + oldAmount + " of tnt for " + event.getEntity().getName() + " but removed " + remove.size() + " instead"); _tntCount.get(event.getEntity()).set(0); }