SteamWar/BauSystem
Archiviert
13
0

ChaosBauGUI #183

Manuell gemergt
YoyoNow hat 20 Commits von ChaosBauGUI nach master 2021-02-24 19:16:17 +01:00 zusammengeführt
2 geänderte Dateien mit 24 neuen und 18 gelöschten Zeilen
Nur Änderungen aus Commit 35902fac56 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -71,9 +71,9 @@ public class CommandGUI implements CommandExecutor, Listener {
OPEN_INVS.remove(player);
});
inv.setItem(37, Material.GLASS_PANE, "§7Platzhalter", clickType -> {});
inv.setItem(38, Material.GLASS_PANE, "§7Platzhalter", clickType -> {});
inv.setItem(43, Material.GLASS_PANE, "§7Platzhalter", clickType -> {});
inv.setItem(37, getMaterial("GLASS_PANE", "THIN_GLASS"), "§7Platzhalter", clickType -> {});
inv.setItem(38, getMaterial("GLASS_PANE", "THIN_GLASS"), "§7Platzhalter", clickType -> {});
inv.setItem(43, getMaterial("GLASS_PANE", "THIN_GLASS"), "§7Platzhalter", clickType -> {});
inv.setItem(42, Material.NETHER_STAR, "§7Bau GUI Item", Arrays.asList("§7Du kannst dieses Item zum Öffnen der BauGUI nutzen", "§7oder Doppel F (Swap hands) drücken."), false, clickType -> {
player.closeInventory();
player.performCommand("gui item");
@ -107,7 +107,7 @@ public class CommandGUI implements CommandExecutor, Listener {
player.performCommand("debugstick");
});
inv.setItem(20, Material.COMPASS, "§7TPS Limitieren", getNoPermsLore(Arrays.asList("§7Aktuell: §e" + CommandTPSLimiter.getCurrentTPSLimit(), "§8/§7tpslimit §8[§e1 - 20§8]"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
inv.setItem(20, Material.COMPASS, "§7TPS Limitieren", getNoPermsLore(Arrays.asList("§7Aktuell: §e" + CommandTPSLimiter.getCurrentTPSLimit(), "§8/§7tpslimit §8[§e0,5 - " + (TPSUtils.isWarpAllowed()?40:20) + "§8]"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if(Welt.noPermission(player, Permission.world))
return;
SWAnvilInv anvilInv = new SWAnvilInv(player, "TPS Limitieren");
@ -273,7 +273,7 @@ public class CommandGUI implements CommandExecutor, Listener {
updateInventories();
});
} else {
inv.setItem(3, Material.FIRE_CHARGE, "§7Fire: §eEingeschaltet", getNoPermsLore(Arrays.asList("§8/§7fire"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
inv.setItem(3, getMaterial("FIRE_CHARGE", "FIREBALL"), "§7Fire: §eEingeschaltet", getNoPermsLore(Arrays.asList("§8/§7fire"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if(Welt.noPermission(player, Permission.world))
return;
player.performCommand("fire");
@ -306,22 +306,23 @@ public class CommandGUI implements CommandExecutor, Listener {
if(!isRefreshing)
OPEN_TRACER_INVS.remove(player);
});
List<String> stateLore = Arrays.asList("§7Aktuell: §e" + RecordStateMachine.getRecordStatus().getName(), "§8/§7trace §8[§estart§8, stop §8oder §eauto§8]");
switch (RecordStateMachine.getRecordStatus()) {
case IDLE:
inv.setItem(0, getMaterial("SNOWBALL", "SNOW_BALL"), "§7Tracerstatus", Arrays.asList("§7Aktuell: §e" + RecordStateMachine.getRecordStatus().getName()), false, clickType -> {
inv.setItem(0, getMaterial("SNOWBALL", "SNOW_BALL"), "§7Tracerstatus", stateLore, false, clickType -> {
RecordStateMachine.commandAuto();
updateInventories();
});
break;
case IDLE_AUTO:
inv.setItem(0, Material.ENDER_PEARL, "§7Tracerstatus", Arrays.asList("§7Aktuell: §e" + RecordStateMachine.getRecordStatus().getName()), false, clickType -> {
inv.setItem(0, Material.ENDER_PEARL, "§7Tracerstatus", stateLore, false, clickType -> {
RecordStateMachine.commandStart();
updateInventories();
});
break;
case RECORD:
case RECORD_AUTO:
inv.setItem(0, getMaterial("ENDER_EYE", "EYE_OF_ENDER"), "§7Tracerstatus", Arrays.asList("§7Aktuell: §e" + RecordStateMachine.getRecordStatus().getName()), false, clickType -> {
inv.setItem(0, getMaterial("ENDER_EYE", "EYE_OF_ENDER"), "§7Tracerstatus", stateLore, false, clickType -> {
RecordStateMachine.commandStop();
updateInventories();
});
@ -343,7 +344,7 @@ public class CommandGUI implements CommandExecutor, Listener {
player.performCommand("trace show gui");
});
inv.setItem(6, Material.BARRIER, "§7Trace löschen", clickType -> confirmationInventory(player, "Trace löschen", () -> player.performCommand("trace delete"), () -> {}));
inv.setItem(6, Material.BARRIER, "§7Trace löschen", Arrays.asList("§8/§7trace delete"), false, clickType -> confirmationInventory(player, "Trace löschen", () -> player.performCommand("trace delete"), () -> {}));
inv.setItem(8, Material.ARROW, "§7Zurück", clickType -> {
player.closeInventory();
@ -482,42 +483,43 @@ public class CommandGUI implements CommandExecutor, Listener {
SteamwarUser user = SteamwarUser.get(member.getMemberID());
SWInventory inv = new SWInventory(player, 9, "Member: " + user.getUserName());
if(member.isBuild())
Review

Bitte sowohl um den if block als auch den else block geschweifte Klammern, damit man es besser lesen kann

Bitte sowohl um den if block als auch den else block geschweifte Klammern, damit man es besser lesen kann
inv.setItem(2, getMaterial("GREEN_WOOL", "WOOL"), (byte) 13, "§7Bauen", Arrays.asList("§7Aktuell: §eJa", "§8/§7bau togglebuild §8[§eSpieler§8]"), false, clickType -> {
inv.setItem(0, getMaterial("GREEN_WOOL", "WOOL"), (byte) 13, "§7Bauen", Arrays.asList("§7Aktuell: §eJa", "§8/§7bau togglebuild §8[§eSpieler§8]"), false, clickType -> {
member.setBuild(false);
bauweltMemberGUI(player, member);
});
else
inv.setItem(2, getMaterial("RED_WOOL", "WOOL"), (byte) 14, "§7Bauen", Arrays.asList("§7Aktuell: §eNein", "§8/§7bau togglebuild §8[§eSpieler§8]"), false, clickType -> {
inv.setItem(0, getMaterial("RED_WOOL", "WOOL"), (byte) 14, "§7Bauen", Arrays.asList("§7Aktuell: §eNein", "§8/§7bau togglebuild §8[§eSpieler§8]"), false, clickType -> {
member.setBuild(true);
bauweltMemberGUI(player, member);
});
if(member.isWorldEdit())
inv.setItem(4, getMaterial("GREEN_WOOL", "WOOL"), (byte) 13, "§7Worldedit", Arrays.asList("§7Aktuell: §eJa", "§8/§7bau togglewe §8[§eSpieler§8]"), false, clickType -> {
inv.setItem(2, getMaterial("GREEN_WOOL", "WOOL"), (byte) 13, "§7Worldedit", Arrays.asList("§7Aktuell: §eJa", "§8/§7bau togglewe §8[§eSpieler§8]"), false, clickType -> {
member.setWorldEdit(false);
bauweltMemberGUI(player, member);
});
else
inv.setItem(4, getMaterial("RED_WOOL", "WOOL"), (byte) 14, "§7Worldedit", Arrays.asList("§7Aktuell: §eNein", "§8/§7bau togglewe §8[§eSpieler§8]"), false, clickType -> {
inv.setItem(2, getMaterial("RED_WOOL", "WOOL"), (byte) 14, "§7Worldedit", Arrays.asList("§7Aktuell: §eNein", "§8/§7bau togglewe §8[§eSpieler§8]"), false, clickType -> {
member.setWorldEdit(true);
bauweltMemberGUI(player, member);
});
if(member.isWorld())
inv.setItem(6, getMaterial("GREEN_WOOL", "WOOL"), (byte) 13, "§7World", Arrays.asList("§7Aktuell: §eJa", "§8/§7bau toggleworld §8[§eSpieler§8]"), false, clickType -> {
inv.setItem(4, getMaterial("GREEN_WOOL", "WOOL"), (byte) 13, "§7World", Arrays.asList("§7Aktuell: §eJa", "§8/§7bau toggleworld §8[§eSpieler§8]"), false, clickType -> {
member.setWorld(false);
bauweltMemberGUI(player, member);
});
else
inv.setItem(6, getMaterial("RED_WOOL", "WOOL"), (byte) 14, "§7World", Arrays.asList("§7Aktuell: §eNein", "§8/§7bau toggleworld §8[§eSpieler§8]"), false, clickType -> {
inv.setItem(4, getMaterial("RED_WOOL", "WOOL"), (byte) 14, "§7World", Arrays.asList("§7Aktuell: §eNein", "§8/§7bau toggleworld §8[§eSpieler§8]"), false, clickType -> {
member.setWorld(true);
bauweltMemberGUI(player, member);
});
inv.setItem(8, Material.BARRIER, "§7Member entfernen", clickType -> {
inv.setItem(6, Material.BARRIER, "§7Member entfernen", clickType -> {
player.closeInventory();
confirmChatMessage(player, "/bau delmember " + user.getUserName());
});
inv.setItem(8, Material.ARROW, "§7Zurück", clickType -> bauManagementGUI(player));
inv.open();
}
@ -527,7 +529,7 @@ public class CommandGUI implements CommandExecutor, Listener {
t.setText("[Hier]");
t.setColor(ChatColor.YELLOW);
t.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command));
t.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§8/§7" + command)));
t.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§7" + command)));
player.spigot().sendMessage(t);
}
@ -563,7 +565,7 @@ public class CommandGUI implements CommandExecutor, Listener {
for (String name:names) {
try {
return Material.valueOf(name);
}catch (NullPointerException ignored) {}
}catch (IllegalArgumentException ignored) {}
Review

In den geschweiften Klammern des catch Blockes einfach // Ignored als Kommentar schreiben

In den geschweiften Klammern des catch Blockes einfach `// Ignored` als Kommentar schreiben
}
return null;
}

Datei anzeigen

@ -42,6 +42,7 @@ public class PredefinedBook {
private List<String> lore;
private String author;
private String name;
private ItemStack finishedBook;
PredefinedBook(ConfigurationSection section) {
this.lines = section.getStringList("lines");
@ -51,6 +52,8 @@ public class PredefinedBook {
}
public ItemStack toItemStack() {
if(finishedBook != null)
return finishedBook;
ItemStack book = new ItemStack(getBookMat());
BookMeta meta = (BookMeta) book.getItemMeta();
meta.setPages(getPages());
@ -60,6 +63,7 @@ public class PredefinedBook {
meta.setGeneration(BookMeta.Generation.ORIGINAL);
meta.setLore(lore);
book.setItemMeta(meta);
finishedBook = book;
return book;
}