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 43 neuen und 14 gelöschten Zeilen
Nur Änderungen aus Commit 81c510c8cc werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -49,8 +49,17 @@ public class CommandGUI implements CommandExecutor, Listener {
if(!(commandSender instanceof Player)) if(!(commandSender instanceof Player))
return false; return false;
Player player = ((Player) commandSender); Player player = ((Player) commandSender);
if(strings.length == 0) {
openBauGui(player); openBauGui(player);
OPEN_INVS.add(player); OPEN_INVS.add(player);
}else {
if ("item".equalsIgnoreCase(strings[0])) {
if (player.getInventory().getItemInMainHand().getType() == Material.AIR)
player.getInventory().setItemInMainHand(new ItemStack(Material.NETHER_STAR));
else
player.getInventory().addItem(new ItemStack(Material.NETHER_STAR));
}
}
return true; return true;
} }
@ -65,6 +74,10 @@ public class CommandGUI implements CommandExecutor, Listener {
inv.setItem(37, Material.GLASS_PANE, "§7Platzhalter", clickType -> {}); inv.setItem(37, Material.GLASS_PANE, "§7Platzhalter", clickType -> {});
inv.setItem(38, Material.GLASS_PANE, "§7Platzhalter", clickType -> {}); inv.setItem(38, Material.GLASS_PANE, "§7Platzhalter", clickType -> {});
inv.setItem(43, Material.GLASS_PANE, "§7Platzhalter", clickType -> {}); inv.setItem(43, Material.GLASS_PANE, "§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");
});
ItemStack dtWand = Detonator.WAND.clone(); ItemStack dtWand = Detonator.WAND.clone();
ItemMeta meta = dtWand.getItemMeta(); ItemMeta meta = dtWand.getItemMeta();
@ -75,6 +88,8 @@ public class CommandGUI implements CommandExecutor, Listener {
meta.setLore(lore); meta.setLore(lore);
dtWand.setItemMeta(meta); dtWand.setItemMeta(meta);
inv.setItem(39, dtWand, clickType -> { inv.setItem(39, dtWand, clickType -> {
if(Welt.noPermission(player, Permission.world))
return;
player.closeInventory(); player.closeInventory();
player.performCommand("dt wand"); player.performCommand("dt wand");
}); });
@ -85,13 +100,16 @@ public class CommandGUI implements CommandExecutor, Listener {
player.closeInventory(); player.closeInventory();
player.performCommand("/wand"); player.performCommand("/wand");
}); });
inv.setItem(41, getMaterial("DEBUG_STICK", "STICK"), "§7Debugstick", Arrays.asList("§8/§7debugstick"), Core.getVersion() < 13,clickType -> { inv.setItem(41, getMaterial("DEBUG_STICK", "STICK"), "§eDebugstick", getNoPermsLore(Arrays.asList("§8/§7debugstick"), player, "§cDu hast keine Worldrechte", Permission.world), Core.getVersion() < 13,clickType -> {
if(Welt.noPermission(player, Permission.world))
return;
player.closeInventory(); player.closeInventory();
player.performCommand("debugstick"); player.performCommand("debugstick");
}); });
inv.setItem(42, Material.GLASS_PANE, "§7Platzhalter", clickType -> {});
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[§e1 - 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"); SWAnvilInv anvilInv = new SWAnvilInv(player, "TPS Limitieren");
anvilInv.setItem(Material.COMPASS); anvilInv.setItem(Material.COMPASS);
anvilInv.setCallback(s -> player.performCommand("tpslimit " + s)); anvilInv.setCallback(s -> player.performCommand("tpslimit " + s));
@ -133,7 +151,7 @@ public class CommandGUI implements CommandExecutor, Listener {
traceGUI(player); traceGUI(player);
}); });
inv.setItem(22, Material.DISPENSER, "§7Auto-Loader", getNoPermsLore(Arrays.asList((AutoLoader.hasLoader(player) ? "§aan" : "§caus")), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> { inv.setItem(22, Material.DISPENSER, "§7Auto-Loader", getNoPermsLore(Arrays.asList("§7Status: " + (AutoLoader.hasLoader(player) ? "§aan" : "§caus")), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if(Welt.noPermission(player, Permission.world)) if(Welt.noPermission(player, Permission.world))
return; return;
player.closeInventory(); player.closeInventory();
@ -152,19 +170,28 @@ public class CommandGUI implements CommandExecutor, Listener {
inv.setItem(18, Material.BARRIER, "§eKeine Region", clickType -> {}); inv.setItem(18, Material.BARRIER, "§eKeine Region", clickType -> {});
inv.setItem(27, Material.BARRIER, "§eKeine Region", clickType -> {}); inv.setItem(27, Material.BARRIER, "§eKeine Region", clickType -> {});
}else { }else {
inv.setItem(27, Material.HEAVY_WEIGHTED_PRESSURE_PLATE, "§eRegion Reseten", getNoPermsLore(Arrays.asList("§8/§7reset"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> inv.setItem(27, Material.HEAVY_WEIGHTED_PRESSURE_PLATE, "§eRegion Reseten", getNoPermsLore(Arrays.asList("§8/§7reset"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
confirmationInventory(player, "Region Reseten?", () -> player.performCommand("reset"), () -> openBauGui(player))); if(Welt.noPermission(player, Permission.world))
return;
confirmationInventory(player, "Region Reseten?", () -> player.performCommand("reset"), () -> openBauGui(player));
});
if(region.hasProtection()) { if(region.hasProtection()) {
inv.setItem(18, Material.OBSIDIAN, "§eRegion Protecten", getNoPermsLore(Arrays.asList("§8/§7protect"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> inv.setItem(18, Material.OBSIDIAN, "§eRegion Protecten", getNoPermsLore(Arrays.asList("§8/§7protect"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
confirmationInventory(player, "Region Protecten", () -> player.performCommand("protect"), () -> openBauGui(player))); if(Welt.noPermission(player, Permission.world))
return;
confirmationInventory(player, "Region Protecten", () -> player.performCommand("protect"), () -> openBauGui(player));
});
} else { } else {
inv.setItem(18, Material.BARRIER, "§eRegion nicht Protect bar", clickType -> {}); inv.setItem(18, Material.BARRIER, "§eRegion nicht Protect bar", clickType -> {});
} }
if(region.hasTestblock()) { if(region.hasTestblock()) {
inv.setItem(9, getMaterial("END_STONE", "ENDER_STONE"), "§eTestblock erneuern", getNoPermsLore(Arrays.asList("§8/§7testblock"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> inv.setItem(9, getMaterial("END_STONE", "ENDER_STONE"), "§eTestblock erneuern", getNoPermsLore(Arrays.asList("§8/§7testblock"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
confirmationInventory(player, "Testblock erneuern", () -> player.performCommand("testblock"), () -> openBauGui(player))); if(Welt.noPermission(player, Permission.world))
return;
confirmationInventory(player, "Testblock erneuern", () -> player.performCommand("testblock"), () -> openBauGui(player));
});
} else { } else {
inv.setItem(9, Material.BARRIER, "§eDie Region hat keinen Testblock", clickType -> {}); inv.setItem(9, Material.BARRIER, "§eDie Region hat keinen Testblock", clickType -> {});
} }
@ -194,8 +221,8 @@ public class CommandGUI implements CommandExecutor, Listener {
}); });
} }
boolean isBuildArea = region.buildAreaEnabled(); boolean isBuildArea = region.hasBuildRegion();
List<String> tntLore = getNoPermsLore(Arrays.asList("§8/§7tnt §8[" + (isBuildArea?"§eTB§7, ":"") + "§eOff §7oder §eOn§7]"), player, "§cDu hast keine Worldrechte", Permission.world); List<String> tntLore = getNoPermsLore(Arrays.asList("§8/§7tnt §8[" + (isBuildArea ? "§eTB§7, " : "") + "§eOff §7oder §eOn§7]"), player, "§cDu hast keine Worldrechte", Permission.world);
switch (region.getTntMode()) { switch (region.getTntMode()) {
case OFF: case OFF:
inv.setItem(23, Material.MINECART, "§7TNT: §eAusgeschaltet", tntLore, false, clickType -> { inv.setItem(23, Material.MINECART, "§7TNT: §eAusgeschaltet", tntLore, false, clickType -> {
@ -255,6 +282,8 @@ public class CommandGUI implements CommandExecutor, Listener {
} }
inv.setItem(2, Material.ENDER_PEARL, "§7Teleporter", getNoPermsLore(Arrays.asList("§8/§7tp §8[§eSpieler§8]"), player, "§cDu hast keine Buildrechte", Permission.build), false, clickType -> { inv.setItem(2, Material.ENDER_PEARL, "§7Teleporter", getNoPermsLore(Arrays.asList("§8/§7tp §8[§eSpieler§8]"), player, "§cDu hast keine Buildrechte", Permission.build), false, clickType -> {
if(Welt.noPermission(player, Permission.build))
return;
List<SWListInv.SWListEntry<String>> playerSWListEntry = new ArrayList<>(); List<SWListInv.SWListEntry<String>> playerSWListEntry = new ArrayList<>();
Bukkit.getOnlinePlayers().forEach(player1 -> { Bukkit.getOnlinePlayers().forEach(player1 -> {
if(player1.equals(player)) if(player1.equals(player))

Datei anzeigen

@ -51,7 +51,7 @@ public class Detonator implements Listener {
WAND = new ItemStack(Material.BLAZE_ROD, 1); WAND = new ItemStack(Material.BLAZE_ROD, 1);
Review

Auch überprüfen, ob das Material in der 1.12 genauso hieß.

Auch überprüfen, ob das Material in der 1.12 genauso hieß.
ItemMeta im = WAND.getItemMeta(); ItemMeta im = WAND.getItemMeta();
im.setDisplayName("§6Fernzünder"); im.setDisplayName("§eFernzünder");
Review

Eigentlich separater PR, aber ziemlich wumpe.

Eigentlich separater PR, aber ziemlich wumpe.
List<String> lorelist = Arrays.asList("§eLinks Klick §8- §7Setzte einen Punkt zum Aktivieren", List<String> lorelist = Arrays.asList("§eLinks Klick §8- §7Setzte einen Punkt zum Aktivieren",
"§eLinks Klick + Shift §8- §7Füge einen Punkt hinzu", "§eRechts Klick §8- §7Löse alle Punkte aus"); "§eLinks Klick + Shift §8- §7Füge einen Punkt hinzu", "§eRechts Klick §8- §7Löse alle Punkte aus");