From 357e6451c5de5678259f2bcc7bd93c020ebda602 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 25 Jul 2020 10:47:28 +0200 Subject: [PATCH 01/17] Test autoloader fix --- .../src/de/steamwar/bausystem/world/AutoLoader_15.java | 7 +++++++ 1 file changed, 7 insertions(+) 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..15d77b8 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -4,6 +4,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.Directional; import org.bukkit.block.data.Powerable; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; @@ -31,6 +32,12 @@ class AutoLoader_15 { powerable.setPowered(active); block.setBlockData(powerable); block.getState().update(true); + + if(data instanceof Directional){ + Directional directional = (Directional) data; + block.getRelative(directional.getFacing()).getState().update(true); + } + return true; } From 402f6b0a112d33f8077949f9e0872c1b4bf004d5 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 25 Jul 2020 10:49:29 +0200 Subject: [PATCH 02/17] Test autoloader fix --- BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java | 1 + 1 file changed, 1 insertion(+) 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 15d77b8..e847a6e 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -35,6 +35,7 @@ class AutoLoader_15 { if(data instanceof Directional){ Directional directional = (Directional) data; + System.out.println(directional.getFacing().toString()); block.getRelative(directional.getFacing()).getState().update(true); } From 4c581d523cb6774a69bdb942b94ded9f71854a24 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 25 Jul 2020 10:52:59 +0200 Subject: [PATCH 03/17] Test autoloader fix --- .../src/de/steamwar/bausystem/world/AutoLoader_15.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 e847a6e..c6069c5 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -3,6 +3,7 @@ package de.steamwar.bausystem.world; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Directional; import org.bukkit.block.data.Powerable; @@ -34,9 +35,7 @@ class AutoLoader_15 { block.getState().update(true); if(data instanceof Directional){ - Directional directional = (Directional) data; - System.out.println(directional.getFacing().toString()); - block.getRelative(directional.getFacing()).getState().update(true); + block.getRelative(BlockFace.DOWN).getState().update(true); } return true; From 8f4ec3b3fea25b13cc1099129b7c07f89a8d446a Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 25 Jul 2020 10:55:12 +0200 Subject: [PATCH 04/17] Test autoloader fix --- .../src/de/steamwar/bausystem/world/AutoLoader_15.java | 7 ------- 1 file changed, 7 deletions(-) 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 c6069c5..846dd40 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -3,9 +3,7 @@ package de.steamwar.bausystem.world; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.Directional; import org.bukkit.block.data.Powerable; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; @@ -33,11 +31,6 @@ class AutoLoader_15 { powerable.setPowered(active); block.setBlockData(powerable); block.getState().update(true); - - if(data instanceof Directional){ - block.getRelative(BlockFace.DOWN).getState().update(true); - } - return true; } From 9d56f096242b637259c6c22512ede7481dfbc6a0 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 26 Jul 2020 22:52:48 +0200 Subject: [PATCH 05/17] Fix ReducedDebugInfo false --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 0aaaf63..3cab4a7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -268,6 +268,7 @@ public class BauSystem extends JavaPlugin implements Listener { attachment.setPermission("worldedit.fill", true);*/ if (Core.getVersion() == 15) ShowManager.add(p); + Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); } @EventHandler From 72a2b4821d98791a5c600eb3c3c28e68e9606a6c Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 26 Jul 2020 22:55:39 +0200 Subject: [PATCH 06/17] Fix ReducedDebugInfo --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 3cab4a7..4a49d02 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -269,6 +269,7 @@ public class BauSystem extends JavaPlugin implements Listener { if (Core.getVersion() == 15) ShowManager.add(p); Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); + p.setOp(true); } @EventHandler From 2858f87e5d2b8dd753d57d2ef248bd58983aef77 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 26 Jul 2020 22:57:07 +0200 Subject: [PATCH 07/17] Fix DebugInfo --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 4a49d02..6bf0da0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -268,8 +268,8 @@ public class BauSystem extends JavaPlugin implements Listener { attachment.setPermission("worldedit.fill", true);*/ if (Core.getVersion() == 15) ShowManager.add(p); - Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); - p.setOp(true); + //Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); + //p.setOp(true); } @EventHandler From 6b682e666e33bc520dc0646a210583ad2f6e4a05 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 26 Jul 2020 23:00:03 +0200 Subject: [PATCH 08/17] Fix ReducedDebugInfo --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 6bf0da0..8ef44e7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -10,6 +10,7 @@ import de.steamwar.core.Core; import de.steamwar.scoreboard.SWScoreboard; import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; +import org.bukkit.GameRule; import org.bukkit.Material; import org.bukkit.attribute.Attribute; import org.bukkit.configuration.InvalidConfigurationException; @@ -268,8 +269,7 @@ public class BauSystem extends JavaPlugin implements Listener { attachment.setPermission("worldedit.fill", true);*/ if (Core.getVersion() == 15) ShowManager.add(p); - //Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); - //p.setOp(true); + Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); } @EventHandler From 81182f5b6f3ec7df75bd22931d347c77adce8285 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 27 Jul 2020 06:53:08 +0200 Subject: [PATCH 09/17] Fix 1.12 reduced debug info --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 8ef44e7..9ef1d55 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -268,8 +268,10 @@ public class BauSystem extends JavaPlugin implements Listener { attachment.setPermission("worldedit.calc", true); attachment.setPermission("worldedit.fill", true);*/ - if (Core.getVersion() == 15) ShowManager.add(p); - Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); + if (Core.getVersion() == 15){ + ShowManager.add(p); + Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); + } } @EventHandler From e18b2c77d8da178e5f25bdcf6ef32d48f42f0231 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 15 Aug 2020 17:16:41 +0200 Subject: [PATCH 10/17] Remove unnecessary error message --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 1 - 1 file changed, 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 9ef1d55..9dba5da 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -315,7 +315,6 @@ public class BauSystem extends JavaPlugin implements Listener { for (Attribute a : Attribute.values()) meta.removeAttributeModifier(a); stack.setItemMeta(meta); - Bukkit.getLogger().log(Level.SEVERE, "Spieler " + p.getName() + " (" + p.getUniqueId().toString() + ") hat versucht ein Item mit einem Attribute-Modifier zu bekommen."); } e.setCurrentItem(stack); } From d4535ff36dae0b1aab6be5c4b5cf4460027ad603 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 01:15:19 +0200 Subject: [PATCH 11/17] 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; From 6afaeebfae21a1b3833c6d1b643f0f519de307fe Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 09:12:09 +0200 Subject: [PATCH 12/17] Fixed Autoloader 15 Redstone under Block --- .../src/de/steamwar/bausystem/world/AutoLoader_15.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 720a857..2dbcbba 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -36,7 +36,6 @@ class AutoLoader_15 { 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), @@ -45,7 +44,7 @@ class AutoLoader_15 { location.clone().add(0, 0,-1) }; for (Location value : locations) { - if (value.getBlock().getType().toString().contains("SIGN")) continue; + if (!value.getBlock().getType().isSolid()) continue; BlockData data = value.getBlock().getBlockData(); value.getBlock().setType(Material.BARRIER, true); value.getBlock().setBlockData(data, true); From 88a495f4aea9b46a43835ade87fd75e260c04bf8 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 09:30:29 +0200 Subject: [PATCH 13/17] Fixed Sign Text Disappearing if Next to a Button pressed by Auto Loader --- BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java | 2 +- 1 file changed, 1 insertion(+), 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 2dbcbba..dbbb48e 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -44,7 +44,7 @@ class AutoLoader_15 { location.clone().add(0, 0,-1) }; for (Location value : locations) { - if (!value.getBlock().getType().isSolid()) continue; + if (!value.getBlock().getType().isOccluding()) continue; BlockData data = value.getBlock().getBlockData(); value.getBlock().setType(Material.BARRIER, true); value.getBlock().setBlockData(data, true); From bb814a210373b6c201185b4f5aef040949e5fbe5 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 10:27:32 +0200 Subject: [PATCH 14/17] Improved Location Selection --- .../bausystem/world/AutoLoader_15.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) 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 dbbb48e..daa04b0 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -9,6 +9,9 @@ import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; class AutoLoader_15 { + + private static int[][] offsets = new int[][]{{1, 0, 0}, {-2, 0, 0}, {1, 1, 0}, {0, -2, 0}, {0, 1, 1}, {0, 0, -2}, {0, 0, 1}}; + private AutoLoader_15() { } @@ -35,19 +38,12 @@ class AutoLoader_15 { } static void updateBlock(Location location) { - Location[] locations = new Location[] { - 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().isOccluding()) continue; - BlockData data = value.getBlock().getBlockData(); - value.getBlock().setType(Material.BARRIER, true); - value.getBlock().setBlockData(data, true); + for (int[] offset : offsets) { + location.add(offset[0], offset[1], offset[2]); + if (!location.getBlock().getType().isOccluding()) continue; + BlockData data = location.getBlock().getBlockData(); + location.getBlock().setType(Material.BARRIER, true); + location.getBlock().setBlockData(data, true); } } From a933da7c301b5e86b2cd2481529fe84d0fa9e73f Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 29 Aug 2020 11:02:01 +0200 Subject: [PATCH 15/17] Getting next block --- .../bausystem/world/AutoLoader_15.java | 21 ++++++++++++++++++- 1 file changed, 20 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 daa04b0..0ffa968 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -3,8 +3,10 @@ package de.steamwar.bausystem.world; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Powerable; +import org.bukkit.block.data.type.Switch; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; @@ -33,7 +35,24 @@ class AutoLoader_15 { Powerable powerable = (Powerable) data; powerable.setPowered(active); block.setBlockData(powerable); - updateBlock(block.getLocation()); + + if (data instanceof Switch){ + Switch swtch = (Switch) data; + Block relative; + switch(swtch.getFace()){ + case FLOOR: + relative = block.getRelative(BlockFace.DOWN); + break; + case CEILING: + relative = block.getRelative(BlockFace.UP); + break; + default: + relative = block.getRelative(swtch.getFacing()); + break; + } + relative.getState().update(true); + updateBlock(relative.getLocation()); + } return true; } From 4a5e8c3d66a3fc431297be57d5cab468c1b52a50 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 11:18:49 +0200 Subject: [PATCH 16/17] Reduced Number of Updated Blocks --- .../steamwar/bausystem/world/AutoLoader_15.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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 0ffa968..af0148b 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -50,20 +50,15 @@ class AutoLoader_15 { relative = block.getRelative(swtch.getFacing()); break; } - relative.getState().update(true); - updateBlock(relative.getLocation()); + updateBlock(relative); } return true; } - static void updateBlock(Location location) { - for (int[] offset : offsets) { - location.add(offset[0], offset[1], offset[2]); - if (!location.getBlock().getType().isOccluding()) continue; - BlockData data = location.getBlock().getBlockData(); - location.getBlock().setType(Material.BARRIER, true); - location.getBlock().setBlockData(data, true); - } + static void updateBlock(Block block) { + BlockData data = block.getBlockData(); + block.setType(Material.BARRIER, true); + block.setBlockData(data, true); } static void onPlayerInteract(IAutoLoader loader, PlayerInteractEvent event) { From 7b3fcf90b10ee27a8386bb8efb2338cc157a6983 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 11:19:42 +0200 Subject: [PATCH 17/17] Removed Offset Array --- BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java | 2 -- 1 file changed, 2 deletions(-) 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 af0148b..e0b478e 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -12,8 +12,6 @@ import org.bukkit.event.player.PlayerInteractEvent; class AutoLoader_15 { - private static int[][] offsets = new int[][]{{1, 0, 0}, {-2, 0, 0}, {1, 1, 0}, {0, -2, 0}, {0, 1, 1}, {0, 0, -2}, {0, 0, 1}}; - private AutoLoader_15() { }