SteamWar/BauSystem2.0
Archiviert
12
0

Add CustomCommandListener copy

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-08-24 17:02:51 +02:00
Ursprung c6208161ab
Commit 2ec444d477

Datei anzeigen

@ -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 -> { playerMap.getOrDefault(p, new ArrayList<>()).stream().filter(MenuCommand.class::isInstance).map(MenuCommand.class::cast).forEach(menuCommand -> {
String command = "§e" + String.join(" ", menuCommand.args); 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)); }), menuCommand));
}); });
SWListInv<MenuCommand> menuCommandSWListInv = new SWListInv<>(p, "§eScript Commands", false, menuCommands, (clickType, menuCommand) -> { SWListInv<MenuCommand> 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()); SWUtils.giveItemToPlayer(p, menuCommand.toItem());
p.closeInventory(); p.closeInventory();
save(p); save(p);