From 2ec444d4775379cd5cdcb2b1b0d60a8c11b2aa9e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 24 Aug 2021 17:02:51 +0200 Subject: [PATCH] Add CustomCommandListener copy Signed-off-by: yoyosource --- .../bausystem/features/script/CustomCommandListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java index dbddcd35..c484d4da 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomCommandListener.java @@ -235,11 +235,13 @@ public class CustomCommandListener implements Listener { playerMap.getOrDefault(p, new ArrayList<>()).stream().filter(MenuCommand.class::isInstance).map(MenuCommand.class::cast).forEach(menuCommand -> { String command = "§e" + String.join(" ", menuCommand.args); - menuCommands.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, command, Arrays.asList("§7Klicke zum rausnehmen"), false, clickType -> { + menuCommands.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, command, Arrays.asList("§7Klicke zum rausnehmen", "§7Middle Klicke zum kopieren"), false, clickType -> { }), menuCommand)); }); SWListInv menuCommandSWListInv = new SWListInv<>(p, "§eScript Commands", false, menuCommands, (clickType, menuCommand) -> { - playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand); + if (!clickType.isCreativeAction()) { + playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand); + } SWUtils.giveItemToPlayer(p, menuCommand.toItem()); p.closeInventory(); save(p);