From d9d383679f72776c8e9facd994e58c0305c79b3d Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 23 Aug 2022 11:50:28 +0200 Subject: [PATCH] Fix Detonator type selection --- .../features/detonator/Detonator.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 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 8fc98497..c1ffd756 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java @@ -189,13 +189,6 @@ public class Detonator { } static Detoblock getBlock(Block block) { - if (block.getType() == Material.STONE_BUTTON) { - return Detoblock.STONE_BUTTON; - } - if (block.getType() == Material.HEAVY_WEIGHTED_PRESSURE_PLATE || block.getType() == Material.LIGHT_WEIGHTED_PRESSURE_PLATE) { - return Detoblock.WEIGHTED_PRESSURE_PLATE; - } - switch (block.getType()) { case LEVER: return Detoblock.SWITCH; @@ -205,16 +198,19 @@ public class Detonator { return Detoblock.NOTEBLOCK; case DAYLIGHT_DETECTOR: return Detoblock.DAYLIGHTSENSOR; + case HEAVY_WEIGHTED_PRESSURE_PLATE: + case LIGHT_WEIGHTED_PRESSURE_PLATE: + return Detoblock.WEIGHTED_PRESSURE_PLATE; default: - if (block.getBlockData() instanceof Powerable) { + if (block.getType().name().contains("STONE_BUTTON")) { + return Detoblock.STONE_BUTTON; + } else if (block.getType().name().contains("BUTTON")) { + return Detoblock.WOOD_BUTTON; + } else if (block.getType().name().contains("PRESSURE_PLATE")) { + return Detoblock.PRESSURE_PLATE; + } else if (block.getBlockData() instanceof Powerable) { return Detoblock.POWERABLE; } else { - if (block.getType().name().contains("BUTTON")) { - return Detoblock.WOOD_BUTTON; - } - if (block.getType().name().contains("PRESSURE_PLATE")) { - return Detoblock.PRESSURE_PLATE; - } return Detoblock.INVALID; } } -- 2.39.2