SteamWar/BauSystem
Archiviert
13
0

New Region System

Dieser Commit ist enthalten in:
Chaoscaot 2021-02-03 21:01:21 +01:00
Ursprung a7df81aca5
Commit 886cf5607d

Datei anzeigen

@ -34,7 +34,7 @@ public class CommandGUI implements CommandExecutor {
} }
public static void openBauGui(Player player) { public static void openBauGui(Player player) {
Region region = Region.getRegionIn(player.getLocation()); Region region = Region.getRegion(player.getLocation());
SWInventory inv = new SWInventory(player, 5*9, SteamwarUser.get(BauSystem.getOwner()).getUserName() + "s Bau"); SWInventory inv = new SWInventory(player, 5*9, SteamwarUser.get(BauSystem.getOwner()).getUserName() + "s Bau");
inv.setCallback(-1, clickType -> { inv.setCallback(-1, clickType -> {
if(!isRefreshing) if(!isRefreshing)
@ -127,46 +127,46 @@ public class CommandGUI implements CommandExecutor {
}); });
} }
switch (CommandTNT.getTntMode()) { switch (region.getTntMode()) {
case OFF: case OFF:
inv.setItem(40, Material.MINECART, "§7TNT: §eAusgeschaltet", Arrays.asList("§8/§7tnt §8[" + (Region.buildAreaEnabled()?"§etb§8, ":"") + "§eOff §7oder §eOn§7]"), false, clickType -> { inv.setItem(40, Material.MINECART, "§7TNT: §eAusgeschaltet", Arrays.asList("§8/§7tnt §8[" + (Region.buildAreaEnabled()?"§etb§8, ":"") + "§eOff §7oder §eOn§7]"), false, clickType -> {
CommandTNT.setTntMode(Region.buildAreaEnabled()?CommandTNT.TNTMode.ONLY_TB: CommandTNT.TNTMode.ON); region.setTntMode(Region.buildAreaEnabled()?CommandTNT.TNTMode.ONLY_TB: CommandTNT.TNTMode.ON);
updateInventories(); updateInventories();
}); });
break; break;
case ONLY_TB: case ONLY_TB:
inv.setItem(40, Material.TNT_MINECART, "§7TNT: §enur Testblock", Arrays.asList("§8/§7tnt §8[" + (Region.buildAreaEnabled()?"§etb§8, ":"") + "§eOff §7oder §eOn§7]"), false, clickType -> { inv.setItem(40, Material.TNT_MINECART, "§7TNT: §enur Testblock", Arrays.asList("§8/§7tnt §8[" + (Region.buildAreaEnabled()?"§etb§8, ":"") + "§eOff §7oder §eOn§7]"), false, clickType -> {
CommandTNT.setTntMode(CommandTNT.TNTMode.ON); region.setTntMode(CommandTNT.TNTMode.ON);
updateInventories(); updateInventories();
}); });
break; break;
default: default:
inv.setItem(40, Material.TNT, "§7TNT: §eEingeschaltet", Arrays.asList("§8/§7tnt §8[" + (Region.buildAreaEnabled()?"§etb§8, ":"") + "§eOff §7oder §eOn§7]"), false, clickType -> { inv.setItem(40, Material.TNT, "§7TNT: §eEingeschaltet", Arrays.asList("§8/§7tnt §8[" + (Region.buildAreaEnabled()?"§etb§8, ":"") + "§eOff §7oder §eOn§7]"), false, clickType -> {
CommandTNT.setTntMode(CommandTNT.TNTMode.OFF); region.setTntMode(CommandTNT.TNTMode.OFF);
updateInventories(); updateInventories();
}); });
} }
if(CommandFreeze.getInstance().isOn()) { if(region.isFreeze()) {
inv.setItem(41, Material.GUNPOWDER, "§7Freeze: §eEingeschaltet", Arrays.asList("§8/§7freeze"), false, clickType -> { inv.setItem(41, Material.GUNPOWDER, "§7Freeze: §eEingeschaltet", Arrays.asList("§8/§7freeze"), false, clickType -> {
CommandFreeze.getInstance().toggle(); region.setFreeze(false);
updateInventories(); updateInventories();
}); });
} else { } else {
inv.setItem(41, Material.REDSTONE, "§7Freeze: §eAusgeschaltet", Arrays.asList("§8/§7freeze"), false, clickType -> { inv.setItem(41, Material.REDSTONE, "§7Freeze: §eAusgeschaltet", Arrays.asList("§8/§7freeze"), false, clickType -> {
CommandFreeze.getInstance().toggle(); region.setFreeze(true);
updateInventories(); updateInventories();
}); });
} }
if(CommandFire.getInstance().isOn()) { if(region.isFire()) {
inv.setItem(42, getMaterial("FIREWORK_STAR", "FIREWORK_CHARGE"), "§7Fire: §eAusgeschaltet", Arrays.asList("§8/§7fire"), false, clickType -> { inv.setItem(42, getMaterial("FIREWORK_STAR", "FIREWORK_CHARGE"), "§7Fire: §eAusgeschaltet", Arrays.asList("§8/§7fire"), false, clickType -> {
CommandFire.getInstance().toggle(); region.setFire(false);
updateInventories(); updateInventories();
}); });
} else { } else {
inv.setItem(42, Material.FIRE_CHARGE, "§7Fire: §eEingeschaltet", Arrays.asList("§8/§7fire"), false, clickType -> { inv.setItem(42, Material.FIRE_CHARGE, "§7Fire: §eEingeschaltet", Arrays.asList("§8/§7fire"), false, clickType -> {
CommandFire.getInstance().toggle(); region.setFire(true);
updateInventories(); updateInventories();
}); });
} }