From 4470b60aafce7aaa3f657322613eab7e4d0dffbb Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Sat, 12 Feb 2022 23:18:57 +0100 Subject: [PATCH] Remove unused code block. Turns out igniting TNT _doesn't_ fire a BlockIgniteEvent but rather an ExplosionPrimeEvent, which means this code has never actually been of any use. This code block was likely dead on arrival and has been dead for almost 9 years. Wonderful... The proper handling here would be to listen for the PlayerInteractEvent and detect flint and steel interactions with TNT blocks. This is super cumbersome, however, because the event handler would have to listen on the MONITOR priority to ensure that nothing changes down the line. What we are _actually_ need to do is remove the TNT block from the arena's block set when it is ignited, but since this hasn't worked for almost a decade, we're not really in a hurry to fix it now. It just makes for a slightly slower (but negligible) cleanup procedure most of the time. --- .../java/com/garbagemule/MobArena/ArenaListener.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/main/java/com/garbagemule/MobArena/ArenaListener.java b/src/main/java/com/garbagemule/MobArena/ArenaListener.java index 484baa1..3383968 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaListener.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaListener.java @@ -360,17 +360,7 @@ public class ArenaListener case FLINT_AND_STEEL: if (arena.inEditMode()) return; if (arena.isRunning()) { - if (b.getType() == Material.TNT) { - Player planter = getPlanter(b); - if (planter != null) { - b.setType(Material.AIR); - TNTPrimed tnt = b.getWorld().spawn(b.getLocation(), TNTPrimed.class); - tnt.setSource(planter); - setPlanter(tnt, planter); - } - } else { - arena.addBlock(event.getBlock().getRelative(BlockFace.UP)); - } + arena.addBlock(b.getRelative(BlockFace.UP)); break; } case LIGHTNING: