From d4535ff36dae0b1aab6be5c4b5cf4460027ad603 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 01:15:19 +0200 Subject: [PATCH] Fix Loader Redstone --- .../bausystem/world/AutoLoader_15.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java index 846dd40..720a857 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -30,10 +30,28 @@ class AutoLoader_15 { Powerable powerable = (Powerable) data; powerable.setPowered(active); block.setBlockData(powerable); - block.getState().update(true); + updateBlock(block.getLocation()); return true; } + static void updateBlock(Location location) { + Location[] locations = new Location[] { + location.clone(), + location.clone().add(1, 0,0), + location.clone().add(-1, 0,0), + location.clone().add(0, 1,0), + location.clone().add(0, -1,0), + location.clone().add(0, 0,1), + location.clone().add(0, 0,-1) + }; + for (Location value : locations) { + if (value.getBlock().getType().toString().contains("SIGN")) continue; + BlockData data = value.getBlock().getBlockData(); + value.getBlock().setType(Material.BARRIER, true); + value.getBlock().setBlockData(data, true); + } + } + static void onPlayerInteract(IAutoLoader loader, PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.PHYSICAL) return;