From 886cf5607d9f477c631c3ea7a0abf5b65c8d69ca Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 3 Feb 2021 21:01:21 +0100 Subject: [PATCH] New Region System --- .../bausystem/commands/CommandGUI.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java index 602ae3b..eae86b1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java @@ -34,7 +34,7 @@ public class CommandGUI implements CommandExecutor { } 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"); inv.setCallback(-1, clickType -> { if(!isRefreshing) @@ -127,46 +127,46 @@ public class CommandGUI implements CommandExecutor { }); } - switch (CommandTNT.getTntMode()) { + switch (region.getTntMode()) { case OFF: 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(); }); break; 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 -> { - CommandTNT.setTntMode(CommandTNT.TNTMode.ON); + region.setTntMode(CommandTNT.TNTMode.ON); updateInventories(); }); break; default: 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(); }); } - if(CommandFreeze.getInstance().isOn()) { + if(region.isFreeze()) { inv.setItem(41, Material.GUNPOWDER, "§7Freeze: §eEingeschaltet", Arrays.asList("§8/§7freeze"), false, clickType -> { - CommandFreeze.getInstance().toggle(); + region.setFreeze(false); updateInventories(); }); } else { inv.setItem(41, Material.REDSTONE, "§7Freeze: §eAusgeschaltet", Arrays.asList("§8/§7freeze"), false, clickType -> { - CommandFreeze.getInstance().toggle(); + region.setFreeze(true); updateInventories(); }); } - if(CommandFire.getInstance().isOn()) { + if(region.isFire()) { inv.setItem(42, getMaterial("FIREWORK_STAR", "FIREWORK_CHARGE"), "§7Fire: §eAusgeschaltet", Arrays.asList("§8/§7fire"), false, clickType -> { - CommandFire.getInstance().toggle(); + region.setFire(false); updateInventories(); }); } else { inv.setItem(42, Material.FIRE_CHARGE, "§7Fire: §eEingeschaltet", Arrays.asList("§8/§7fire"), false, clickType -> { - CommandFire.getInstance().toggle(); + region.setFire(true); updateInventories(); }); }