From d936324b9510a8ba7ef80a4d84890724690cb6bb Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 4 Dec 2021 22:11:38 +0100 Subject: [PATCH 1/4] Hotfix Loadtimer Signed-off-by: yoyosource --- .../de/steamwar/bausystem/features/loadtimer/Loadtimer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java index 6af89373..6601e494 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java @@ -132,6 +132,9 @@ public class Loadtimer implements Listener { if (stage == Stage.COUNTING) { if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { Material type = event.getClickedBlock().getType(); + if (type == Material.IRON_TRAPDOOR) { + return; + } if (type.name().contains("_BUTTON") || type == Material.LEVER || type.name().contains("_TRAPDOOR") || type == Material.NOTE_BLOCK) { setActivate(); } From 338e5c6ee8bf38da968f865195138462b0926ced Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 5 Dec 2021 19:45:10 +0100 Subject: [PATCH 2/4] Test TNTSimulatorListener --- .../bausystem/features/simulator/TNTSimulatorListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java index b85ed1b2..ba3b3763 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -119,6 +119,7 @@ public class TNTSimulatorListener implements Listener, Disable { if (event.getItem() == null || !event.getItem().isSimilar(WAND)) { return; } + System.out.println(event); event.setCancelled(true); if (!permissionCheck(event.getPlayer())) { From 38086589fc4fd751439efd4774841e18bd61db47 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 5 Dec 2021 21:02:46 +0100 Subject: [PATCH 3/4] Test TNTSimulatorListener --- .../bausystem/features/smartplace/SmartPlaceListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java index 7ee8fd45..5669cae3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java @@ -64,6 +64,7 @@ public class SmartPlaceListener implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { + System.out.println(event); if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; if (event.getPlayer().getGameMode() == GameMode.SPECTATOR) return; if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return; From cd360c1911812fe1a432ec4a46ccb2fbbe4ae370 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 5 Dec 2021 21:07:44 +0100 Subject: [PATCH 4/4] Test TNTSimulatorListener --- .../features/simulator/TNTSimulatorDisable.java | 16 ++++++++++++++++ .../features/simulator/TNTSimulatorListener.java | 11 +---------- .../features/smartplace/SmartPlaceListener.java | 2 -- 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorDisable.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorDisable.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorDisable.java new file mode 100644 index 00000000..4c7e3e24 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorDisable.java @@ -0,0 +1,16 @@ +package de.steamwar.bausystem.features.simulator; + +import de.steamwar.bausystem.linkage.Disable; +import de.steamwar.bausystem.linkage.LinkageType; +import de.steamwar.bausystem.linkage.Linked; + +@Linked(LinkageType.DISABLE_LINK) +public class TNTSimulatorDisable implements Disable { + + @Override + public void disable() { + for (TNTSimulator simulator : TNTSimulator.TNT_SIMULATOR_MAP.values()) { + simulator.save(); + } + } +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java index ba3b3763..f2743fb8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -23,7 +23,6 @@ package de.steamwar.bausystem.features.simulator; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; -import de.steamwar.bausystem.linkage.Disable; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import org.bukkit.FluidCollisionMode; @@ -48,8 +47,7 @@ import static de.steamwar.bausystem.features.simulator.TNTSimulator.WAND; import static de.steamwar.bausystem.features.simulator.TNTSimulator.get; @Linked(LinkageType.LISTENER) -@Linked(LinkageType.DISABLE_LINK) -public class TNTSimulatorListener implements Listener, Disable { +public class TNTSimulatorListener implements Listener { private boolean permissionCheck(Player player) { if (!Permission.hasPermission(player, Permission.WORLD)) { @@ -144,11 +142,4 @@ public class TNTSimulatorListener implements Listener, Disable { public void onPlayerQuit(PlayerQuitEvent event) { get(event.getPlayer()).saveAndDelete(); } - - @Override - public void disable() { - for (TNTSimulator simulator : TNTSimulator.TNT_SIMULATOR_MAP.values()) { - simulator.save(); - } - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java index 5669cae3..74adbee9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java @@ -37,7 +37,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; @Linked(LinkageType.LISTENER) @@ -64,7 +63,6 @@ public class SmartPlaceListener implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { - System.out.println(event); if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; if (event.getPlayer().getGameMode() == GameMode.SPECTATOR) return; if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return;