From 4ff706e1ef9d0342a04eddc81a68757f81f3d901 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 17 Dec 2023 12:20:36 +0100 Subject: [PATCH] Fix Gui --- .../simulator/gui/SimulatorRedstoneGui.java | 14 +++++++------- .../features/simulator/gui/SimulatorTNTGui.java | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorRedstoneGui.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorRedstoneGui.java index 1475cee4..2e288895 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorRedstoneGui.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorRedstoneGui.java @@ -101,20 +101,20 @@ public class SimulatorRedstoneGui extends SimulatorScrollGui { + inventory.setItem(47, new SWItem(Material.REPEATER, "§eSettings", clickType -> { new SimulatorRedstoneSettingsGui(player, simulator, redstone, this).open(); })); - // Group chooser - inventory.setItem(49, new SWItem(Material.LEAD, "§eJoin Group", clickType -> { - new SimulatorGroupChooserGui(player, simulator, redstone, redstone.getGroup(simulator), this).open(); - })); - // Enable/Disable - inventory.setItem(50, new SWItem(redstone.isDisabled() ? Material.ENDER_PEARL : Material.ENDER_EYE, redstone.isDisabled() ? "§cDisabled" : "§aEnabled", clickType -> { + inventory.setItem(48, new SWItem(redstone.isDisabled() ? Material.ENDER_PEARL : Material.ENDER_EYE, redstone.isDisabled() ? "§cDisabled" : "§aEnabled", clickType -> { redstone.setDisabled(!redstone.isDisabled()); SimulatorWatcher.update(simulator); })); + + // Group chooser + inventory.setItem(51, new SWItem(Material.LEAD, "§eJoin Group", clickType -> { + new SimulatorGroupChooserGui(player, simulator, redstone, redstone.getGroup(simulator), this).open(); + })); } @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorTNTGui.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorTNTGui.java index a6d6c944..a9c178ce 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorTNTGui.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/SimulatorTNTGui.java @@ -93,8 +93,9 @@ public class SimulatorTNTGui extends SimulatorScrollGui { inventory.setItem(47, new SWItem(Material.REPEATER, "§eSettings", clickType -> { new SimulatorTNTSettingsGui(player, simulator, tnt, this).open(); })); - inventory.setItem(48, new SWItem(Material.LEAD, "§eJoin Group", clickType -> { - new SimulatorGroupChooserGui(player, simulator, tnt, tnt.getGroup(simulator), this).open(); + inventory.setItem(48, new SWItem(tnt.isDisabled() ? Material.ENDER_PEARL : Material.ENDER_EYE, tnt.isDisabled() ? "§cDisabled" : "§aEnabled", clickType -> { + tnt.setDisabled(!tnt.isDisabled()); + SimulatorWatcher.update(simulator); })); inventory.setItem(50, new SWItem(Material.CHEST, parent.getElements().size() == 1 ? "§eMake Group" : "§eAdd another TNT to Group", clickType -> { TNTElement tntElement = new TNTElement(tnt.getPosition().clone()); @@ -103,9 +104,8 @@ public class SimulatorTNTGui extends SimulatorScrollGui { new SimulatorGroupGui(player, simulator, parent, new SimulatorGui(player, simulator)).open(); SimulatorWatcher.update(simulator); })); - inventory.setItem(51, new SWItem(tnt.isDisabled() ? Material.ENDER_PEARL : Material.ENDER_EYE, tnt.isDisabled() ? "§cDisabled" : "§aEnabled", clickType -> { - tnt.setDisabled(!tnt.isDisabled()); - SimulatorWatcher.update(simulator); + inventory.setItem(51, new SWItem(Material.LEAD, "§eJoin Group", clickType -> { + new SimulatorGroupChooserGui(player, simulator, tnt, tnt.getGroup(simulator), this).open(); })); }