SteamWar/BauSystem2.0
Archiviert
12
0

Update ScriptCommand menu creation with lore of items.
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-02-01 09:41:29 +01:00
Ursprung 5407c3f9b4
Commit 21e9c50ecd
2 geänderte Dateien mit 22 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -438,6 +438,8 @@ SCRIPT_GUI_CUSTOM_EVENTS_LORE_14 = §7 hasBlock §8[§7blockX, blockY, blockZ
SCRIPT_GUI_CUSTOM_EVENTS_LORE_15 = §eTNTSpawn
SCRIPT_GUI_CUSTOM_EVENTS_LORE_16 = §eTNTExplode §8-§7 x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_17 = §eTNTExplodeInBuild §8-§7 x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_18 = §eSelfJoin §8-§7 x, y, z, playerName
SCRIPT_GUI_CUSTOM_EVENTS_LORE_19 = §eSelfLeave §8-§7 x, y, z, playerName
SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_1 = §e* §8-§7 Alles in den Klammern ist nur gesetzt,
SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_2 = §7wenn die Variable dafür gesetzt ist.

Datei anzeigen

@ -29,6 +29,23 @@ public class ScriptCommand extends SWCommand {
private static List<SWListInv.SWListEntry<SpecialCommand>> swItems = new ArrayList<>();
private List<String> loreBuilder(Player p, String prefix, int start, int end) {
List<String> lore = new ArrayList<>();
for (int i = start; i <= end; i++) {
lore.add(BauSystem.MESSAGE.parse(prefix + i, p));
}
return lore;
}
private List<String> loreBuilder(Player p, String prefix, int start, int end, List<String> append) {
List<String> lore = new ArrayList<>();
for (int i = start; i <= end; i++) {
lore.add(BauSystem.MESSAGE.parse(prefix + i, p));
}
lore.addAll(append);
return lore;
}
@Register(description = "SCRIPT_COMMAND_HELP")
public void menuCommand(Player p) {
if (swItems.isEmpty()) {
@ -36,11 +53,11 @@ public class ScriptCommand extends SWCommand {
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {
}), null));
}
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_2", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_3", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_4", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_5", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_6", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_7", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_8", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_9", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_10", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_11", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_12", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS_LORE_13", p)), false, clickType -> {
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_COMMANDS", p), loreBuilder(p, "SCRIPT_GUI_CUSTOM_COMMANDS_LORE_", 1, 13), false, clickType -> {
}), null));
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_2", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_3", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_4", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_5", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_6", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_7", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_8", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_9", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_10", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_11", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_12", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_13", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_14", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_15", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_16", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_17", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_2", p)), false, clickType -> {
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_CUSTOM_EVENTS", p), loreBuilder(p, "SCRIPT_GUI_CUSTOM_EVENTS_LORE_", 1, 19, loreBuilder(p, "SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_", 1, 2)), false, clickType -> {
}), null));
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER", p), Arrays.asList(BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_1", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_2", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_3", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_4", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_5", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_6", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_7", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_8", p), BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER_LORE_9", p)), false, clickType -> {
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.BOOK, BauSystem.MESSAGE.parse("SCRIPT_GUI_OTHER", p), loreBuilder(p, "SCRIPT_GUI_OTHER_LORE_", 1, 9), false, clickType -> {
}), null));
for (int i = 0; i < 3; i++) {
swItems.add(new SWListInv.SWListEntry<>(new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§7", new ArrayList<>(), false, clickType -> {