SteamWar/BauSystem
Archiviert
13
0
Dieser Commit ist enthalten in:
jojo 2021-01-26 15:22:53 +01:00
Ursprung 96be3d5259
Commit 28b818f799

Datei anzeigen

@ -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);
}
}