Add CustomCommandListener copy
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
c6208161ab
Commit
2ec444d477
@ -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) -> {
|
||||||
|
if (!clickType.isCreativeAction()) {
|
||||||
playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand);
|
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);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren