From 659f09cb8294a7d96af40e7b6f6f752626e21965 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 6 Aug 2022 11:21:48 +0200 Subject: [PATCH] Fix Detonator for pressure plates and buttons Signed-off-by: yoyosource --- .../features/detonator/Detonator.java | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java index a610a0de..84616670 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java @@ -189,29 +189,22 @@ public class Detonator { } static Detoblock getBlock(Block block) { + if (block.getType() == Material.STONE_BUTTON) { + return Detoblock.STONE_BUTTON; + } + if (block.getType().name().contains("BUTTON")) { + return Detoblock.WOOD_BUTTON; + } + if (block.getType() == Material.HEAVY_WEIGHTED_PRESSURE_PLATE || block.getType() == Material.LIGHT_WEIGHTED_PRESSURE_PLATE) { + return Detoblock.WEIGHTED_PRESSURE_PLATE; + } + if (block.getType().name().contains("PRESSURE_PLATE")) { + return Detoblock.PRESSURE_PLATE; + } + switch (block.getType()) { case LEVER: return Detoblock.SWITCH; - case ACACIA_BUTTON: - case BIRCH_BUTTON: - case DARK_OAK_BUTTON: - case JUNGLE_BUTTON: - case OAK_BUTTON: - case SPRUCE_BUTTON: - return Detoblock.WOOD_BUTTON; - case STONE_BUTTON: - return Detoblock.STONE_BUTTON; - case ACACIA_PRESSURE_PLATE: - case BIRCH_PRESSURE_PLATE: - case DARK_OAK_PRESSURE_PLATE: - case JUNGLE_PRESSURE_PLATE: - case OAK_PRESSURE_PLATE: - case SPRUCE_PRESSURE_PLATE: - case STONE_PRESSURE_PLATE: - return Detoblock.PRESSURE_PLATE; - case HEAVY_WEIGHTED_PRESSURE_PLATE: - case LIGHT_WEIGHTED_PRESSURE_PLATE: - return Detoblock.WEIGHTED_PRESSURE_PLATE; case TRIPWIRE: return Detoblock.TRIPWIRE; case NOTE_BLOCK: