diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java index 11cacde1..689be980 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java @@ -44,7 +44,7 @@ public class AttributeRemoveCommand extends SWCommand { @Register({"all"}) @Register({"*"}) - public void genericCommand(Player player) { + public void genericCommand(@Validator Player player) { ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setLore(new ArrayList<>()); @@ -53,7 +53,7 @@ public class AttributeRemoveCommand extends SWCommand { } @Register(description = "ATTRIBUTE_REMOVE_COMMAND_HELP") - public void genericCommand(Player player, @Mapper("attribute") String attribute) { + public void genericCommand(@Validator Player player, @Mapper("attribute") String attribute) { ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemMeta itemMeta = itemStack.getItemMeta(); if (itemMeta == null) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java index 01d652b4..808ca339 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java @@ -41,7 +41,7 @@ public class AttributesCopyCommand extends SWCommand { } @Register - public void genericCommand(Player player) { + public void genericCommand(@Validator Player player) { Block block = player.getTargetBlockExact(8, FluidCollisionMode.ALWAYS); if (block == null) return; ItemStack mainHand = player.getInventory().getItemInMainHand(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java index de4b192a..965d8bad 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.attributescopy; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.linkage.Linked; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -40,6 +41,7 @@ public class AttributesPlaceListener implements Listener { @EventHandler public void onBlockPlace(BlockPlaceEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; ItemStack itemStack = event.getItemInHand(); ItemMeta itemMeta = itemStack.getItemMeta(); if (itemMeta == null) return; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartCommand.java index 8e2b8c1a..3401267e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartCommand.java @@ -32,7 +32,7 @@ public class AutoStartCommand extends SWCommand { } @Register(description = "AUTOSTART_COMMAND_HELP") - public void genericCommand(Player p) { + public void genericCommand(@Validator Player p) { SWUtils.giveItemToPlayer(p, AutostartListener.getWandItem(p)); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartGuiItem.java index a66e3785..f622d70b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutoStartGuiItem.java @@ -50,6 +50,6 @@ public class AutoStartGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.MEMBER; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java index 7da0fea1..28fb7f94 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/autostart/AutostartListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.autostart; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.features.tpslimit.TPSUtils; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.RegionUtils; @@ -66,6 +67,7 @@ public class AutostartListener implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!ItemUtils.isItem(event.getItem(), "autostart")) { return; } @@ -83,6 +85,7 @@ public class AutostartListener implements Listener { if (!(event.getPlayer() instanceof Player)) { return; } + if(!Permission.BUILD.hasPermission((Player) event.getPlayer())) return; if (!ItemUtils.isItem(event.getPlayer().getInventory().getItemInMainHand(), "autostart")) { return; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/backup/BackupCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/backup/BackupCommand.java index ba7035dc..f4194a4e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/backup/BackupCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/backup/BackupCommand.java @@ -140,13 +140,6 @@ public class BackupCommand extends SWCommand { return SWCommandUtils.createMapper(s -> s, (commandSender, s) -> listBackup((Player) commandSender)); } - @ClassValidator(value = Player.class, local = true) - public TypeValidator backupValidator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "BACKUP_NO_PERMS"); - }; - } - private List listBackup(Player p) { Region region = Region.getRegion(p.getLocation()); if (checkGlobalRegion(region, p)) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/design/endstone/DesignEndStoneCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/design/endstone/DesignEndStoneCommand.java index bafa3206..35a7fa7a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/design/endstone/DesignEndStoneCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/design/endstone/DesignEndStoneCommand.java @@ -45,7 +45,7 @@ public class DesignEndStoneCommand extends SWCommand implements Listener { private Map designEndStoneMap = new HashMap<>(); @Register(description = "DESIGN_ENDSTONE_COMMAND_HELP") - public void genericCommand(Player player) { + public void genericCommand(@Validator Player player) { Region region = Region.getRegion(player.getLocation()); if (!region.hasType(RegionType.BUILD)) { BauSystem.MESSAGE.send("DESIGN_ENDSTONE_REGION_ERROR", player); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java index 2207ce45..3f633663 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java @@ -47,6 +47,6 @@ public class DetonatorBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.MEMBER; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java index bb71245d..c8d493bd 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java @@ -58,12 +58,12 @@ public class DetonatorCommand extends SWCommand { } @Register(value = "wand", description = "DETONATOR_HELP_WAND") - public void giveWand(Player p) { + public void giveWand(@Validator Player p) { SWUtils.giveItemToPlayer(p, getWAND(p)); } @Register(value = "click", description = "DETONATOR_HELP_CLICK") - public void clickDetonator(Player p) { + public void clickDetonator(@Validator Player p) { Detonator.activateDetonator(new ItemStorage(p)); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java index be8e8ce9..0ea3c469 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.detonator; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage; import de.steamwar.bausystem.features.detonator.storage.ItemStorage; @@ -65,6 +66,7 @@ public class DetonatorListener implements Listener { @EventHandler public void onBlockBreak(BlockBreakEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; Player p = event.getPlayer(); if (Detonator.isDetonator(p.getInventory().getItemInMainHand())) { event.setCancelled(true); @@ -75,6 +77,7 @@ public class DetonatorListener implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Detonator.isDetonator(event.getItem())) { return; } @@ -89,6 +92,7 @@ public class DetonatorListener implements Listener { @EventHandler(ignoreCancelled = true) public void onPlayerMove(PlayerMoveEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Detonator.isDetonator(event.getPlayer().getInventory().getItemInMainHand())) { if (Detonator.hasActiveDetonatorShow(event.getPlayer())) { Detonator.hideDetonator(event.getPlayer()); @@ -110,6 +114,7 @@ public class DetonatorListener implements Listener { @EventHandler public void onPlayerItemHeld(PlayerItemHeldEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (Detonator.isDetonator(event.getPlayer().getInventory().getItemInMainHand())) { HAS_UPDATED.add(event.getPlayer()); } @@ -117,6 +122,7 @@ public class DetonatorListener implements Listener { @EventHandler public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (Detonator.isDetonator(event.getMainHandItem()) || Detonator.isDetonator(event.getOffHandItem())) { HAS_UPDATED.add(event.getPlayer()); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java index 9b52890c..77a13716 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java @@ -35,7 +35,7 @@ public class HotbarCommand extends SWCommand { } @Register(value = "load", description = "HOTBAR_HELP_LOAD") - public void loadHotbar(Player p) { + public void loadHotbar(@Validator Player p) { DefaultHotbar.setHotbar(p); BauSystem.MESSAGE.send("HOTBAR_LOADED", p); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarListener.java index de00331f..8a4c78de 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarListener.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.hotbar; +import de.steamwar.bausystem.Permission; import de.steamwar.linkage.Linked; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -30,6 +31,7 @@ public class HotbarListener implements Listener { @EventHandler(priority = EventPriority.LOWEST) public void onPlayerJoin(PlayerJoinEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (allNull(event.getPlayer().getInventory().getContents()) && allNull(event.getPlayer().getInventory().getArmorContents())) { DefaultHotbar.setHotbar(event.getPlayer()); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/inventoryfiller/InventoryFiller.java b/BauSystem_Main/src/de/steamwar/bausystem/features/inventoryfiller/InventoryFiller.java index f72d08f2..d69e3410 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/inventoryfiller/InventoryFiller.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/inventoryfiller/InventoryFiller.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.inventoryfiller; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.configplayer.Config; import de.steamwar.linkage.Linked; import net.md_5.bungee.api.ChatMessageType; @@ -38,6 +39,7 @@ public class InventoryFiller implements Listener { @EventHandler public void onPlayerDropItem(PlayerDropItemEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("inventoryfill", false)) return; if (!event.getPlayer().isSneaking()) return; Block block = event.getPlayer().getTargetBlockExact(5); @@ -59,6 +61,7 @@ public class InventoryFiller implements Listener { */ @EventHandler public void onPlayerItemHeld(PlayerItemHeldEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("inventoryfill", false)) return; if (!event.getPlayer().isSneaking()) return; ItemStack itemStack = event.getPlayer().getInventory().getItemInMainHand(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java index 1340f1c1..bbba61ea 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java @@ -54,7 +54,7 @@ public class KillcheckerCommand extends SWCommand implements Listener { } @Register(value = "enable", description = "KILLCHECKER_HELP_ENABLE") - public void genericCommand(Player player, @OptionalValue("-outline") @StaticValue(value = {"-area", "-outline"}, allowISE = true) boolean onlyOutline) { + public void genericCommand(@Validator Player player, @OptionalValue("-outline") @StaticValue(value = {"-area", "-outline"}, allowISE = true) boolean onlyOutline) { Region region = Region.getRegion(player.getLocation()); KillcheckerVisualizer killcheckerVisualizer = visualizers.computeIfAbsent(region, region1 -> new KillcheckerVisualizer(region1, bossBarService)); killcheckerVisualizer.recalc(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java index 22e0df02..266cd65b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.loader; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.features.loader.elements.LoaderElement; import de.steamwar.bausystem.features.loader.elements.LoaderInteractionElement; import de.steamwar.bausystem.features.loader.elements.impl.LoaderTNT; @@ -70,6 +71,7 @@ public class Loader implements Listener { BauSystem.runTaskTimer(BauSystem.getInstance(), () -> { if (stage != Stage.RUNNING) return; + if(!Permission.BUILD.hasPermission(p)) return; if (waitTime > 0) { waitTime--; return; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java index b065c3d2..55264ec2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java @@ -101,11 +101,4 @@ public class LoaderCommand extends SWCommand { BauSystem.MESSAGE.send("LOADER_NEW_LOAD_TIME", p, delay); loader.setTicksBetweenBlocks(delay); } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator loaderValidator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "LOADER_PERMS"); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderScoreboardElement.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderScoreboardElement.java index b3e2ba2f..fdcda57a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderScoreboardElement.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderScoreboardElement.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.loader; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.utils.ScoreboardElement; import de.steamwar.linkage.Linked; @@ -40,6 +41,7 @@ public class LoaderScoreboardElement implements ScoreboardElement { @Override public String get(Region region, Player p) { + if(!Permission.BUILD.hasPermission(p)) return null; Loader loader = Loader.getLoader(p); if (loader == null) return null; if (loader.getStage() == Loader.Stage.RUNNING) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java index 42d5175c..503c1b47 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java @@ -32,12 +32,12 @@ public class LoadtimerCommand extends SWCommand { } @Register(value = "start", description = "LOADTIMER_HELP_START_1") - public void start(Player p) { + public void start(@Validator Player p) { start(p, TimerMode.HALF); } @Register(value = "start", description = {"LOADTIMER_HELP_START_2", "LOADTIMER_HELP_START_3"}) - public void start(Player p, TimerMode mode) { + public void start(@Validator Player p, TimerMode mode) { Region r = Region.getRegion(p.getLocation()); if (r.isGlobal()) return; if (!Loadtimer.hasTimer(r)) @@ -45,7 +45,7 @@ public class LoadtimerCommand extends SWCommand { } @Register(value = "stop", description = "LOADTIMER_HELP_STOP") - public void stop(Player p) { + public void stop(@Validator Player p) { Region r = Region.getRegion(p.getLocation()); if (r.isGlobal()) return; if (Loadtimer.hasTimer(r)) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java index fd0df724..dbd3e48a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.observer; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.command.SWCommand; import de.steamwar.linkage.Linked; import org.bukkit.entity.Player; @@ -52,7 +53,7 @@ public class ObserverTracerCommand extends SWCommand { } @Register(value = "retrace", description = "OBSERVER_HELP_RETRACE") - public void retrace(Player p) { + public void retrace(@Validator Player p) { if (ObserverTracerListener.observerTracerMap.containsKey(p)) { BauSystem.MESSAGE.send("OBSERVER_RETRACE_NO_TRACE", p); return; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java index b841755b..801f9ce0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.observer; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.linkage.Linked; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -55,6 +56,7 @@ public class ObserverTracerListener implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!enabled.contains(event.getPlayer())) { return; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java index 543d8727..7c60aef2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java @@ -85,7 +85,7 @@ public class ColorCommand extends SWCommand { @ClassValidator(value = Player.class, local = true) public TypeValidator validator() { return (commandSender, player, messageSender) -> { - return !messageSender.send(!bauServer.getOwner().equals(player.getUniqueId()), "REGION_COLOR_NO_PERMS"); + return !messageSender.send(!bauServer.getOwner().equals(player.getUniqueId()), "NO_PERMISSION"); }; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireCommand.java index da5b2665..3a0d4403 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireCommand.java @@ -46,10 +46,6 @@ public class FireCommand extends SWCommand { } } - private String getNoPermMessage() { - return "REGION_FIRE_NO_PERMS"; - } - private String getEnableMessage() { return "REGION_FIRE_ENABLED"; } @@ -69,11 +65,4 @@ public class FireCommand extends SWCommand { return false; } } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), getNoPermMessage()); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeCommand.java index 339ea122..d154ce66 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeCommand.java @@ -46,10 +46,6 @@ public class FreezeCommand extends SWCommand { } } - private String getNoPermMessage() { - return "REGION_FREEZE_NO_PERMS"; - } - private String getEnableMessage(){ return "REGION_FREEZE_ENABLED"; } @@ -69,11 +65,4 @@ public class FreezeCommand extends SWCommand { return true; } } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), getNoPermMessage()); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsCommand.java index d1709dc7..8c4452cb 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsCommand.java @@ -49,10 +49,6 @@ public class ItemsCommand extends SWCommand { } } - private String getNoPermMessage() { - return "REGION_ITEMS_NO_PERMS"; - } - private String getEnableMessage(){ return "REGION_ITEMS_ENABLED"; } @@ -72,11 +68,4 @@ public class ItemsCommand extends SWCommand { return true; } } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), getNoPermMessage()); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectCommand.java index 3793d3ec..4fc33cf0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectCommand.java @@ -54,13 +54,6 @@ public class ProtectCommand extends SWCommand { } } - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "REGION_PROTECT_NO_PERMS"); - }; - } - private Region regionCheck(Player player) { Region region = Region.getRegion(player.getLocation()); if (region.getFloorLevel() == 0) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java index 5caf0af3..28da6094 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java @@ -71,7 +71,7 @@ public class RegionCommand extends SWCommand { } @Register(value = "undo", description = "REGION_REGION_HELP_UNDO") - public void undoCommand(@Validator("WORLD_EDIT") Player p) { + public void undoCommand(@Validator Player p) { Region region = Region.getRegion(p.getLocation()); if (checkGlobalRegion(region, p)) return; @@ -83,7 +83,7 @@ public class RegionCommand extends SWCommand { } @Register(value = "redo", description = "REGION_REGION_HELP_REDO") - public void redoCommand(@Validator("WORLD_EDIT") Player p) { + public void redoCommand(@Validator Player p) { Region region = Region.getRegion(p.getLocation()); if (checkGlobalRegion(region, p)) { return; @@ -97,7 +97,7 @@ public class RegionCommand extends SWCommand { } @Register(value = "restore", description = "REGION_REGION_HELP_RESTORE") - public void genericRestoreCommand(@Validator("WORLD_EDIT") Player p) { + public void genericRestoreCommand(@Validator Player p) { Region region = Region.getRegion(p.getLocation()); if(checkGlobalRegion(region, p)) return; @@ -114,7 +114,7 @@ public class RegionCommand extends SWCommand { } @Register(value = "restore", description = "REGION_REGION_HELP_RESTORE_SCHEMATIC") - public void schematicRestoreCommand(@Validator("WORLD_EDIT") Player p, SchematicNode node) { + public void schematicRestoreCommand(@Validator Player p, SchematicNode node) { Region region = Region.getRegion(p.getLocation()); if (checkGlobalRegion(region, p)) return; @@ -176,7 +176,7 @@ public class RegionCommand extends SWCommand { @Register(value = "changetype", description = "REGION_REGION_HELP_CHANGETYPE") @Register("type") - public void changeTypeCommand(@Validator("WORLD") Player p, @Mapper("regionTypeMapper") String s) { + public void changeTypeCommand(@Validator Player p, @Mapper("regionTypeMapper") String s) { Region region = Region.getRegion(p.getLocation()); if (checkGlobalRegion(region, p)) { return; @@ -210,7 +210,7 @@ public class RegionCommand extends SWCommand { @Register(value = "changeskin", description = "REGION_REGION_HELP_CHANGESKIN") @Register("skin") - public void changeSkinCommand(@Validator("WORLD") Player p, @Mapper("skinTypeMapper") String s) { + public void changeSkinCommand(@Validator Player p, @Mapper("skinTypeMapper") String s) { Region region = Region.getRegion(p.getLocation()); if (checkGlobalRegion(region, p)) { return; @@ -266,18 +266,4 @@ public class RegionCommand extends SWCommand { } }; } - - @Validator(value = "WORLD", local = true) - public TypeValidator worldValidator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "REGION_REGION_NO_PERMS"); - }; - } - - @Validator(value = "WORLD_EDIT", local = true) - public TypeValidator worldEditValidator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "REGION_REGION_NO_PERMS"); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java index 03a22027..680224a7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java @@ -97,13 +97,6 @@ public class ResetCommand extends SWCommand { } } - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "REGION_RESET_NO_PERMS"); - }; - } - private Region regionCheck(Player player) { Region region = Region.getRegion(player.getLocation()); if (region == GlobalRegion.getInstance()) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTCommand.java index af9f3837..27dcbe8f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTCommand.java @@ -157,11 +157,4 @@ public class TNTCommand extends SWCommand { break; } } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "REGION_TNT_NO_PERMS"); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 3572cf71..6b319062 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -157,11 +157,6 @@ public class TestblockCommand extends SWCommand { }; } - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "REGION_TB_NO_PERMS"); - } - private Region regionCheck(Player player) { Region region = Region.getRegion(player.getLocation()); if (!region.hasType(RegionType.TESTBLOCK)) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java index 01714fba..79101ee9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java @@ -57,6 +57,6 @@ public class FireBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLD; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java index 43d1903f..1406638c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java @@ -57,6 +57,6 @@ public class FreezeBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLD; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java index 652c2fb2..a11e508d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java @@ -58,6 +58,6 @@ public class ProtectBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java index 79f6537a..e5295b2e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java @@ -65,6 +65,6 @@ public class ResetBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java index 7b0f25e0..355b5209 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java @@ -64,6 +64,6 @@ public class TestblockBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java index 673a9295..38f1b04a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java @@ -116,6 +116,6 @@ public class TntBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLD; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java index 9d640d52..0194514f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java @@ -31,7 +31,7 @@ public class ScriptCommand extends SWCommand { } @Register - public void genericCommand(Player player) { + public void genericCommand(@Validator Player player) { ScriptGUI.open(player); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java index 61b8862d..ed88d2ee 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptListener.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.script; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.utils.FlatteningWrapper; import de.steamwar.linkage.Linked; import org.bukkit.entity.Player; @@ -42,6 +43,8 @@ public class ScriptListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onLeftClick(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; + ItemStack item = event.getItem(); if (item == null || FlatteningWrapper.impl.isNoBook(item) || item.getItemMeta() == null) { return; @@ -68,6 +71,7 @@ public class ScriptListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; ScriptRunner.updateGlobalScript(event.getPlayer()); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/CommandListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/CommandListener.java index 77bd991e..da5f1f21 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/CommandListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/CommandListener.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.script.event; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.features.script.ScriptRunner; import de.steamwar.linkage.Linked; import org.bukkit.entity.Player; @@ -41,6 +42,7 @@ public class CommandListener implements Listener { @EventHandler public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; String[] split = event.getMessage().split(" "); if (calledCommands.getOrDefault(event.getPlayer(), new HashSet<>()).contains(split[0])) { return; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java index 89f9667e..9f38c219 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.script.event; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.features.script.ScriptRunner; import de.steamwar.bausystem.features.script.lua.SteamWarGlobalLuaPlugin; import de.steamwar.bausystem.features.script.lua.libs.StorageLib; @@ -64,17 +65,20 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.SelfJoin, LuaValue.NIL, event); } @EventHandler(priority = EventPriority.HIGH) public void onPlayerQuit(PlayerQuitEvent event) { StorageLib.removePlayer(event.getPlayer()); + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.SelfLeave, LuaValue.NIL, event); } @EventHandler(priority = EventPriority.HIGH) public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (LAST_FS.containsKey(event.getPlayer())) { Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.DoubleSwap, LuaValue.NIL, event); @@ -86,6 +90,7 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onBlockPlace(BlockPlaceEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; LuaTable table = new LuaTable(); table.set("x", event.getBlock().getX()); table.set("y", event.getBlock().getY()); @@ -96,6 +101,7 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onBlockBreak(BlockBreakEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; LuaTable table = new LuaTable(); table.set("x", event.getBlock().getX()); table.set("y", event.getBlock().getY()); @@ -108,6 +114,7 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.LOW) public void onPlayerInteract(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (ignore.remove(event.getPlayer())) { return; } @@ -144,6 +151,7 @@ public class EventListener implements Listener { Region tntRegion = Region.getRegion(event.getLocation()); for (Player player : Bukkit.getOnlinePlayers()) { + if(!Permission.BUILD.hasPermission(player)) continue; if (tntRegion.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL)) { ScriptRunner.callEvent(player, SteamWarGlobalLuaPlugin.EventType.TNTSpawn, LuaValue.NIL, event); } @@ -165,6 +173,7 @@ public class EventListener implements Listener { boolean inBuild = event.blockList().stream().anyMatch(block -> tntRegion.inRegion(block.getLocation(), RegionType.BUILD, RegionExtensionType.EXTENSION)); for (Player player : Bukkit.getOnlinePlayers()) { + if(!Permission.BUILD.hasPermission(player)) continue; if (tntRegion.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL)) { ScriptRunner.callEvent(player, SteamWarGlobalLuaPlugin.EventType.TNTExplode, table, event); if (inBuild) { @@ -176,6 +185,7 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onPlayerDropItem(PlayerDropItemEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; ignore.add(event.getPlayer()); LuaTable table = new LuaTable(); table.set("type", event.getItemDrop().getItemStack().getType().name()); @@ -185,6 +195,7 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onEntityDeath(EntityDeathEvent event) { for (Player player : Bukkit.getOnlinePlayers()) { + if(!Permission.BUILD.hasPermission(player)) continue; LuaTable table = new LuaTable(); table.set("type", event.getEntityType().name()); ScriptRunner.callEvent(player, SteamWarGlobalLuaPlugin.EventType.EntityDeath, table, event); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/HotkeyListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/HotkeyListener.java index d27a314e..52843f79 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/HotkeyListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/HotkeyListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.script.event; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.features.script.ScriptRunner; import de.steamwar.linkage.Linked; import de.steamwar.linkage.api.Plain; @@ -36,6 +37,7 @@ public class HotkeyListener implements PluginMessageListener, Plain { @Override public void onPluginMessageReceived(String channel, Player player, byte[] message) { + if(!Permission.BUILD.hasPermission(player)) return; if (!channel.equals("sw:hotkeys")) return; if (message.length < 5) return; int action = message[4] & 0xFF; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/shieldprinting/ShieldPrintingCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/shieldprinting/ShieldPrintingCommand.java index d1b60349..20bbd8df 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/shieldprinting/ShieldPrintingCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/shieldprinting/ShieldPrintingCommand.java @@ -108,8 +108,8 @@ public class ShieldPrintingCommand extends SWCommand implements Listener { @ClassValidator(value = Player.class, local = true) public TypeValidator validator() { return (commandSender, player, messageSender) -> { - if (!Permission.hasPermission(player, Permission.WORLD)) { - messageSender.send("SHIELD_PRINTING_DISALLOWED", player); + if (!Permission.BUILD.hasPermission(player)) { + messageSender.send("NO_PERMISSION", player); return false; } Region region = Region.getRegion(player.getLocation()); @@ -123,6 +123,7 @@ public class ShieldPrintingCommand extends SWCommand implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (event.getClickedBlock() == null) { return; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java index 56991431..06af3e68 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java @@ -102,11 +102,4 @@ public class SimulatorCommand extends SWCommand { } }; } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "SIMULATOR_NO_PERMS"); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java index 6ff78e19..5dd31b6a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java @@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.simulator; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.features.simulator.data.Simulator; import de.steamwar.bausystem.features.simulator.data.SimulatorElement; @@ -148,6 +149,7 @@ public class SimulatorCursor implements Listener { } return; } + if(!Permission.BUILD.hasPermission(player)) return; Simulator simulator = SimulatorStorage.getSimulator(player); SimulatorWatcher.show(simulator, player); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java index 86585417..daff9d87 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java @@ -78,11 +78,4 @@ public class LaufbauCommand extends SWCommand { public void laufbauSettings(@Validator Player player) { new LaufbauSettings(player); } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "LAUFBAU_NO_PERM"); - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java index 3bb2379e..8d83d3dd 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java @@ -91,13 +91,6 @@ public class PanzernCommand extends SWCommand { }.runTaskTimer(BauSystem.getInstance(), 1, 1); } - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "PANZERN_NO_PERM"); - }; - } - @Mapper(value = "block", local = true) private TypeMapper blockMapper() { Set strings = new HashSet<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java index f3ab68bf..ea6faa46 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java @@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.smartplace; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.configplayer.Config; import de.steamwar.inventory.SWItem; import de.steamwar.linkage.Linked; @@ -90,6 +91,7 @@ public class SmartPlaceListener implements Plain, Listener { public SmartPlaceListener() { TinyProtocol.instance.addFilter(useItem, (player, packet) -> { + if(!Permission.BUILD.hasPermission(player)) return packet; if (!Config.getInstance().get(player).getPlainValueOrDefault("smartPlace", false)) return packet; Block block = player.getTargetBlockExact(6); boolean shouldSneak = !(block != null && (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) && !CONTAINERS.contains(block.getType()) && !IGNORED.contains(block.getType())); @@ -116,6 +118,7 @@ public class SmartPlaceListener implements Plain, Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return; WAS_EXECUTED.add(event.getPlayer()); if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; @@ -134,6 +137,7 @@ public class SmartPlaceListener implements Plain, Listener { @EventHandler public void onBlockPlace(BlockPlaceEvent event) { + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return; if (!SMART_PLACING.contains(event.getPlayer())) { if (CONTAINERS.contains(event.getBlockAgainst().getType())) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java index b6c6975e..731b583a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java @@ -55,7 +55,7 @@ public class TechHiderCommand extends SWCommand implements Listener, ScoreboardE public XrayCommand xrayCommand; @Register(description = "TECHHIDER_HELP") - public void toggleHider(Player player) { + public void toggleHider(@Validator Player player) { Region region = Region.getRegion(player.getLocation()); if (region.isGlobal()) { BauSystem.MESSAGE.send("TECHHIDER_GLOBAL", player); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java index cf34f6f1..8b0796b8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/blockcounter/BlockCounter.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.testblock.blockcounter; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.configplayer.Config; import de.steamwar.bausystem.region.Region; import lombok.experimental.UtilityClass; @@ -49,6 +50,8 @@ public class BlockCounter { } public String getMessage(Player player, int count, int tntCount, long tick, long lastTick) { + if(!Permission.BUILD.hasPermission(player)) return null; + double countPerTNT = (double) count / tntCount; double countPerTick = (double) count / Math.max((lastTick - tick), 1); if (isActive(player)) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java index 43eb40da..b801e324 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java @@ -143,16 +143,6 @@ public class TPSSystem implements Plain { }.runTaskTimer(BauSystem.getInstance(), 1, 1); } - public TypeValidator player() { - return (commandSender, player, messageSender) -> { - if (!Permission.hasPermission(player, Permission.WORLD)) { - messageSender.send("TPSLIMIT_NO_PERMS"); - return false; - } - return true; - }; - } - private class TPSBaseCommand extends SWCommand { private TPSBaseCommand() { @@ -160,11 +150,6 @@ public class TPSSystem implements Plain { setMessage(BauSystem.MESSAGE); addDefaultHelpMessage("TPSLIMIT_HELP"); } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator player() { - return TPSSystem.this.player(); - } } @AbstractSWCommand.PartOf(TPSBaseCommand.class) @@ -230,11 +215,6 @@ public class TPSSystem implements Plain { super("tick"); setMessage(BauSystem.MESSAGE); } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator player() { - return TPSSystem.this.player(); - } } @AbstractSWCommand.PartOf(TickBaseCommand.class) @@ -403,7 +383,7 @@ public class TPSSystem implements Plain { @Override public Permission permission() { - return Permission.WORLD; + return Permission.BUILD; } } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index 366cc7a3..004f841b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -243,15 +243,4 @@ public class TraceCommand extends SWCommand { } }; } - - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - if (!Permission.hasPermission(player, Permission.WORLD)) { - messageSender.send("TRACE_MESSAGE_DISALLOWED", player); - return false; - } - return true; - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java index 5df27f45..5df2ce7b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java @@ -96,6 +96,6 @@ public class TracerBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLD; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/BindCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/BindCommand.java index ab213c83..820b20b6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/BindCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/BindCommand.java @@ -1,6 +1,7 @@ package de.steamwar.bausystem.features.util; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.features.script.ScriptCommand; import de.steamwar.bausystem.features.script.ScriptRunner; @@ -62,7 +63,7 @@ public class BindCommand extends SWCommand implements Listener { } @Register(description = "OTHER_BIND_HELP") - public void bind(Player player, @Mapper("command") @ErrorMessage("OTHER_BIND_ERROR") String... command) { + public void bind(@Validator Player player, @Mapper("command") @ErrorMessage("OTHER_BIND_ERROR") String... command) { bindInternal(player, command); } @@ -91,6 +92,7 @@ public class BindCommand extends SWCommand implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { if (!event.hasItem()) return; + if(!Permission.BUILD.hasPermission(event.getPlayer())) return; ItemStack itemStack = event.getItem(); ItemMeta meta = itemStack.getItemMeta(); if (meta == null) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java index 290223a2..c534e38d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java @@ -17,7 +17,7 @@ public class BookReplaceCommand extends SWCommand { } @Register("color") - public void color(Player player) { + public void color(@Validator Player player) { ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemMeta itemMeta = itemStack.getItemMeta(); if (itemMeta instanceof BookMeta) { @@ -29,7 +29,7 @@ public class BookReplaceCommand extends SWCommand { } @Register("uncolor") - public void uncolor(Player player) { + public void uncolor(@Validator Player player) { ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemMeta itemMeta = itemStack.getItemMeta(); if (itemMeta instanceof BookMeta) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java index e2de740f..5b87464c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java @@ -34,7 +34,7 @@ public class DebugStickCommand extends SWCommand { } @Register(description = "DEBUG_STICK_COMMAND_HELP") - public void genericCommand(Player p) { + public void genericCommand(@Validator Player p) { SWUtils.giveItemToPlayer(p, new ItemStack(Material.DEBUG_STICK)); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/KillAllCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/KillAllCommand.java index 49654a05..e08b40c0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/KillAllCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/KillAllCommand.java @@ -45,12 +45,12 @@ public class KillAllCommand extends SWCommand { } @Register(description = "OTHER_KILLALL_HELP_SELF") - public void genericCommand(Player player) { + public void genericCommand(@Validator Player player) { genericCommand(player, RegionSelectionType.LOCAL); } @Register(description = "OTHER_KILLALL_HELP_ALL") - public void genericCommand(Player player, RegionSelectionType regionSelectionType) { + public void genericCommand(@Validator Player player, RegionSelectionType regionSelectionType) { Region region = Region.getRegion(player.getLocation()); AtomicLong count = new AtomicLong(0); if (regionSelectionType == RegionSelectionType.GLOBAL || GlobalRegion.getInstance() == region) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SelectCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SelectCommand.java index bd8566ea..e9c2c09a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SelectCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SelectCommand.java @@ -45,13 +45,6 @@ public class SelectCommand extends SWCommand { baurahmenCommand(p, RegionType.TESTBLOCK, regionExtensionType); } - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "SELECT_NO_PERMS"); - }; - } - private void setSelection(RegionType regionType, RegionExtensionType regionExtensionType, Region region, Player p) { Point minPoint = region.getMinPoint(regionType, regionExtensionType); Point maxPoint = region.getMaxPoint(regionType, regionExtensionType); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java index 9bb2331d..1f50a2ae 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java @@ -43,7 +43,7 @@ public class SkullCommand extends SWCommand { } @Register(description = "SKULL_HELP") - public void giveCommand(Player p, @Mapper("player") @ErrorMessage("SKULL_INVALID") String skull) { + public void giveCommand(@Validator Player p, @Mapper("player") @ErrorMessage("SKULL_INVALID") String skull) { ItemStack is = SWItem.getPlayerSkull(skull).getItemStack(); SkullMeta sm = (SkullMeta) is.getItemMeta(); assert sm != null; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java index 277eb59a..44bae130 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java @@ -34,7 +34,7 @@ public class StructureVoidCommand extends SWCommand { } @Register(description = "STRUCTURE_VOID_COMMAND_HELP") - public void genericCommand(Player p) { + public void genericCommand(@Validator Player p) { SWUtils.giveItemToPlayer(p, new ItemStack(Material.STRUCTURE_VOID, 1)); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/TNTClickListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/TNTClickListener.java index 9bb8368f..85f73e04 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/TNTClickListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/TNTClickListener.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.util; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; import de.steamwar.linkage.Linked; import org.bukkit.Bukkit; import org.bukkit.entity.Entity; @@ -34,9 +35,9 @@ public class TNTClickListener implements Listener { @EventHandler public void onPlayerInteractEntity(PlayerInteractEntityEvent event) { - if (event.getHand() != EquipmentSlot.HAND) { - return; - } + if (event.getHand() != EquipmentSlot.HAND) return; + if (!Permission.BUILD.hasPermission(event.getPlayer())); + Entity entity = event.getRightClicked(); if (event.getRightClicked() instanceof TNTPrimed) { TNTPrimed tntPrimed = (TNTPrimed) entity; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/TimeCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/TimeCommand.java index 15f48590..249f4072 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/TimeCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/TimeCommand.java @@ -66,13 +66,6 @@ public class TimeCommand extends SWCommand { }, s -> tabCompletions); } - @ClassValidator(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { - return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "OTHER_TIME_NO_PERM"); - }; - } - public enum Time { NIGHT(18000), DAY(6000), diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java index 725d75b1..c6341818 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java @@ -50,6 +50,6 @@ public class DebugstickBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.MEMBER; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java index 42a4588a..a5f76346 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java @@ -62,6 +62,6 @@ public class KillAllBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.MEMBER; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java index 30ac88a2..6b9b6775 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java @@ -39,7 +39,7 @@ public class NavWandBauGuiItem extends BauGuiItem { } @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.MEMBER; } @Override public ItemStack getItem(Player player) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java index dc5569e4..027d6c9c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java @@ -18,7 +18,7 @@ public class SchemBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.BUILD; } @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java index 2e90be13..b0feb305 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java @@ -88,7 +88,7 @@ public class SelectBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.BUILD; } @AllArgsConstructor diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java index f9ec57c8..c7e500db 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java @@ -54,6 +54,6 @@ public class SkullBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.MEMBER; + return Permission.BUILD; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java index ddfa66d7..9ef2400f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java @@ -40,7 +40,7 @@ public class WorldEditBauGuiItem extends BauGuiItem { @Override public Permission permission() { - return Permission.WORLDEDIT; + return Permission.BUILD; } @Override