From 00f54816301ad1c6cffd7ad94316541f43351c12 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 28 Nov 2025 12:15:34 +0100 Subject: [PATCH] Fix tnt only listeners detecting WindCharges --- .../bausystem/features/autostart/AutostartListener.java | 2 ++ .../src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java | 2 ++ .../bausystem/features/simulator/execute/StabGenerator.java | 2 ++ .../features/testblock/blockcounter/BlockCounterListener.java | 2 ++ 4 files changed, 8 insertions(+) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java index d45a7029..efa7f199 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java @@ -32,6 +32,7 @@ import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.data.type.Chest; import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityExplodeEvent; @@ -120,6 +121,7 @@ public class AutostartListener implements Listener { @EventHandler public void onEntityExplode(EntityExplodeEvent event) { + if (!(event.getEntity() instanceof TNTPrimed)) return; if (regionStartTime.isEmpty()) { return; } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java index f1a42e1a..a7d642fe 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java @@ -29,6 +29,7 @@ import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; import org.bukkit.boss.BossBar; import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; @@ -156,6 +157,7 @@ public class Loadtimer implements Listener { } public void onTntExplode(EntityExplodeEvent event) { + if (!(event.getEntity() instanceof TNTPrimed)) return; if (region.getBuildArea().inRegion(event.getLocation(), true) && stage == Stage.IGNITION) { stage = Stage.END; explode = TPSUtils.currentRealTick.get(); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/StabGenerator.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/StabGenerator.java index 809358b6..37d1a5f0 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/StabGenerator.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/StabGenerator.java @@ -26,6 +26,7 @@ import de.steamwar.bausystem.utils.PasteBuilder; import de.steamwar.bausystem.utils.bossbar.BauSystemBossbar; import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; @@ -51,6 +52,7 @@ public class StabGenerator extends StabStep implements Listener { @EventHandler public void onEntityExplode(EntityExplodeEvent event) { + if (!(event.getEntity() instanceof TNTPrimed)) return; if (Region.getRegion(event.getEntity().getLocation()) == data.region) { event.blockList().forEach(block -> { if (!data.region.getTestblockArea().inRegion(block.getLocation(), true)) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounterListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounterListener.java index c4f711d8..beb693eb 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounterListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounterListener.java @@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.testblock.blockcounter; import de.steamwar.bausystem.region.Region; import de.steamwar.linkage.Linked; import org.bukkit.block.Block; +import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityExplodeEvent; @@ -34,6 +35,7 @@ public class BlockCounterListener implements Listener { @EventHandler public void onEntityExplode(EntityExplodeEvent event) { + if (!(event.getEntity() instanceof TNTPrimed)) return; Region region = Region.getRegion(event.getLocation()); if (region.getType().isGlobal()) { return;