From 938ace0e3188f74ceaf3e1ea43eda3c226525663 Mon Sep 17 00:00:00 2001 From: Chaos Date: Tue, 15 Mar 2022 17:27:13 +0100 Subject: [PATCH] feat(replay-color): Add GUI Signed-off-by: Chaos --- .../schematicsystem/commands/GUI.java | 21 ++++++++++++++++++- pom.xml | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java index 24d621e..f67d0ca 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java @@ -85,7 +85,7 @@ public class GUI { } Material mat = SWItem.getMaterial(node.getItem()); - inv.setItem(5, mat, "§e" + mat.name(), Arrays.asList("§7Zum Ändern", "§7anklicken"), false, click -> { + inv.setItem(node.isDir()?7:5, mat, "§e" + mat.name(), Arrays.asList("§7Zum Ändern", "§7anklicken"), false, click -> { changeItem(player, node, back); }); if(!node.isDir()) { @@ -96,6 +96,25 @@ public class GUI { player.closeInventory(); SchematicCommandUtils.download(player, node); }); + if(node.getSchemtype().fightType()) { + inv.setItem(14, SWItem.getMaterial(node.replaceColor() ? "PINK_WOOL" : "LIGHT_GRAY_WOOL"), "Farbersetzung", Arrays.asList("§7Aktuell: " + (node.replaceColor()?"§aAn":"§cAus"), "§7Zum Ändern", "§7anklicken"), false, clickType -> { + node.setReplaceColor(!node.replaceColor()); + info(player, node, back); + }); + inv.setItem(13, SWItem.getMaterial(node.allowReplay() ? "EYE_OF_ENDER" : "ENDER_PEAR"), "Replay Wiedergabe", Arrays.asList("§7Aktuell: " + (node.replaceColor()?"§aAn":"§4Aus"), "§7Zum §lAusschaulten", "§7anklicken"), false, clickType -> { + if(node.allowReplay()) { + SWInventory confInv = new SWInventory(player, 9, "Wiedergabe der Schematic Dauerhaft sperren"); + confInv.setItem(0, SWItem.getDye(1), (byte) 1, "§aAbbrechen", type -> { + info(player, node, back); + }); + confInv.setItem(8, SWItem.getDye(10), (byte) 10, "§cBestätigen", type -> { + node.setAllowReplay(false); + info(player, node, back); + }); + confInv.open(); + } + }); + } } SWItem skull = SWItem.getPlayerSkull("MHF_STEVE"); skull.setCallback(click -> { diff --git a/pom.xml b/pom.xml index d1b542e..411fb62 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,7 @@ org.projectlombok lombok 1.18.22 + provided \ No newline at end of file