diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 337ea4a..ca34723 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -93,6 +93,7 @@ public class BauSystem extends JavaPlugin implements Listener { new CommandGUI(); new CommandWorldSpawn(); new CommandRegion(); + new CommandSelect(); Bukkit.getPluginManager().registerEvents(this, this); Bukkit.getPluginManager().registerEvents(new RegionListener(), this); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java index f73270a..a562cf0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java @@ -121,7 +121,7 @@ public class CommandGUI extends SWCommand implements Listener { player.performCommand("redstonetester"); }); - inv.setItem(40, getMaterial("WOODEN_AXE", "WOOD_AXE"), "§eWorldedit Axt", getNoPermsLore(Arrays.asList("§8//§7wand"), player, "§cDu hast keine Worldeditrechte", Permission.worldedit), false, clickType -> { + inv.setItem(40, getMaterial("WOODEN_AXE", "WOOD_AXE"), "§eWorldedit Axt", getNoPermsLore(Arrays.asList("§8//§7wand"), player, "§cDu hast keine Worldeditrechte", Permission.WORLDEDIT), false, clickType -> { if (Welt.noPermission(player, Permission.WORLD)) return; player.closeInventory(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java index 65c602f..2de12c4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java @@ -77,7 +77,7 @@ public class CommandProtect extends SWCommand { } private boolean permissionCheck(Player player) { - if (Welt.noPermission(player, Permission.worldedit)) { + if (Welt.noPermission(player, Permission.WORLDEDIT)) { player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Boden schützen"); return false; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java index bb28fc8..adbd242 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java @@ -60,7 +60,7 @@ public class CommandRegion extends SWCommand { } private boolean permissionCheck(Player player) { - if (Welt.noPermission(player, Permission.worldedit)) { + if (Welt.noPermission(player, Permission.WORLDEDIT)) { player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht die Region verändern"); return false; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSelect.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSelect.java index 7f00202..007bdf0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSelect.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSelect.java @@ -15,7 +15,6 @@ import org.bukkit.entity.Player; public class CommandSelect extends SWCommand { - public static final WorldEditPlugin WORLDEDIT_PLUGIN = ((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit")); public static final World BUKKITWORLD = new BukkitWorld(Bukkit.getWorlds().get(0)); @@ -23,6 +22,11 @@ public class CommandSelect extends SWCommand { super("select"); } + @Register(help = true) + public void genericHelp(Player p, String... args) { + p.sendMessage("§8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp aus"); + p.sendMessage("§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension"); + } @Register public void baurahmenCommand(Player p, RegionType regionType) { @@ -33,13 +37,13 @@ public class CommandSelect extends SWCommand { Region region = Region.getRegion(p.getLocation()); if (GlobalRegion.isGlobalRegion(region)) { - //TODO + p.sendMessage(BauSystem.PREFIX + "§cDie globale Region kannst du nicht auswählen"); return; } if (regionType == RegionType.TESTBLOCK) { if (!region.hasTestblock()) { - //TODO motz den user an + p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keinen Testblock"); return; } setSelection(regionType, RegionExtensionType.NORMAL, region, p); @@ -48,7 +52,7 @@ public class CommandSelect extends SWCommand { if (regionType == RegionType.BUILD) { if (!region.hasBuildRegion()) { - //TODO motz den user an + p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keinen BuildArea"); return; } setSelection(regionType, RegionExtensionType.NORMAL, region, p); @@ -67,13 +71,17 @@ public class CommandSelect extends SWCommand { Region region = Region.getRegion(p.getLocation()); if (GlobalRegion.isGlobalRegion(region)) { - //TODO + p.sendMessage(BauSystem.PREFIX + "§cDie globale Region kannst du nicht auswählen"); return; } if (regionType == RegionType.TESTBLOCK) { - if (!region.hasTestblock() || !region.hasExtensionArea(regionType)) { - //TODO motz den user an + if (!region.hasTestblock()) { + p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keinen Testblock"); + return; + } + if (regionExtensionType == RegionExtensionType.EXTENSION && !region.hasExtensionArea(regionType)) { + p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keine Ausfahrmaße"); return; } setSelection(regionType, regionExtensionType, region, p); @@ -81,8 +89,12 @@ public class CommandSelect extends SWCommand { } if (regionType == RegionType.BUILD) { - if (!region.hasBuildRegion() || !region.hasExtensionArea(regionType)) { - //TODO motz den user an + if (!region.hasBuildRegion()) { + p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keinen BuildArea"); + return; + } + if (regionExtensionType == RegionExtensionType.EXTENSION && !region.hasExtensionArea(regionType)) { + p.sendMessage(BauSystem.PREFIX + "§cDiese Region hat keine Ausfahrmaße"); return; } setSelection(regionType, regionExtensionType, region, p); @@ -95,7 +107,7 @@ public class CommandSelect extends SWCommand { private boolean permissionCheck(Player player) { if (Welt.noPermission(player, Permission.WORLDEDIT)) { - player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den AutoLader verwenden"); + player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Select verwenden"); return false; } return true; @@ -106,5 +118,6 @@ public class CommandSelect extends SWCommand { Point maxPoint = region.getMaxPoint(regionType, regionExtensionType); WORLDEDIT_PLUGIN.getSession(p).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, minPoint.toBlockVector3(), maxPoint.toBlockVector3())); + p.sendMessage(BauSystem.PREFIX + "WorldEdit auswahl auf von " + minPoint.getX() + ", " + minPoint.getY() + ", " + minPoint.getZ() + " bis " + maxPoint.getX() + ", " + maxPoint.getY() + ", " + maxPoint.getZ() + " gesetzt"); } } \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java index bcc9a00..45cc490 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java @@ -77,7 +77,7 @@ public class CommandTestblock extends SWCommand { } private boolean permissionCheck(Player player) { - if (Welt.noPermission(player, Permission.worldedit)) { + if (Welt.noPermission(player, Permission.WORLDEDIT)) { player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Testblock zurücksetzen"); return false; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java index 1b05bdc..5ac6b2f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java @@ -53,7 +53,7 @@ public class RegionListener implements Listener { Player p = e.getPlayer(); - if (Welt.noPermission(p, Permission.worldedit)) { + if (Welt.noPermission(p, Permission.WORLDEDIT)) { p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier kein WorldEdit benutzen"); e.setCancelled(true); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Welt.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Welt.java index e9e40ec..4ffdbaa 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Welt.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Welt.java @@ -42,7 +42,7 @@ public class Welt { switch (perm) { case BUILD: return !member1.isBuild(); - case worldedit: + case WORLDEDIT: return !member1.isWorldEdit(); case WORLD: return !member1.isWorld();