From 28b818f799f7ec7be59f38a101b6643a1daf4cb7 Mon Sep 17 00:00:00 2001 From: jojo Date: Tue, 26 Jan 2021 15:22:53 +0100 Subject: [PATCH] Fix pr stuff --- .../steamwar/bausystem/gui/GuiTraceShow.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java index dc13bbd..6fd07be 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java @@ -53,10 +53,7 @@ public class GuiTraceShow { SWInventory swInventory = new SWInventory(player, 9, "Trace Show GUI"); swInventory.addCloseCallback(clickType -> ShowModeParameterMap.remove(player)); - - SWItem trace_show = new SWItem(Material.LIME_CONCRETE, "§aTraces Angezeigt", new ArrayList<>(), false, clickType -> {}); - SWItem trace_hide = new SWItem(Material.RED_CONCRETE, "§cTraces Ausgeblendet", new ArrayList<>(), false, clickType -> {}); - setActiveShow(player, swInventory, trace_show, trace_hide); + setActiveShow(player, swInventory); SWItem water = new SWItem(Material.TNT, "§eWasser §7Positionen", Arrays.asList("§7Zeigt alles TNT, welches", "§7im Wasser explodiert ist."), false, clickType -> {}); swInventory.setItem(5, water); @@ -76,21 +73,21 @@ public class GuiTraceShow { swInventory.open(); } - private static void setActiveShow(Player player, SWInventory swInventory, SWItem shown, SWItem hidden) { + private static void setActiveShow(Player player, SWInventory swInventory) { if (TraceShowManager.hasActiveShow(player)) { - swInventory.setItem(1, shown); - swInventory.setCallback(1, clickType -> { + SWItem shown = new SWItem(Material.LIME_CONCRETE, "§aTraces angezeigt", new ArrayList<>(), false, clickType -> { TraceShowManager.hide(player); player.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen ausgeblendet"); - setActiveShow(player, swInventory, shown, hidden); + setActiveShow(player, swInventory); }); + swInventory.setItem(1, shown); } else { - swInventory.setItem(1, hidden); - swInventory.setCallback(1, clickType -> { + SWItem hidden = new SWItem(Material.RED_CONCRETE, "§cTraces ausgeblendet", new ArrayList<>(), false, clickType -> { show(player); player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt"); - setActiveShow(player, swInventory, shown, hidden); + setActiveShow(player, swInventory); }); + swInventory.setItem(1, hidden); } }