From 3657dda0947553926a11a2d8711d55860ceea756 Mon Sep 17 00:00:00 2001 From: tastybento Date: Wed, 4 Jul 2018 14:55:34 -0700 Subject: [PATCH] Ops and mod.bypassprotect perms can bypass protection. Moved AbstractFlagListener and clicklisteners into API package --- .../flags/AbstractFlagListener.java | 14 +++++++++----- .../bskyblock/api/flags/FlagBuilder.java | 4 ++-- .../flags/clicklisteners/CycleClick.java | 2 +- .../clicklisteners/IslandToggleClickListener.java | 2 +- .../clicklisteners/WorldToggleClickListener.java | 2 +- .../listeners/flags/BlockInteractionListener.java | 1 + .../listeners/flags/BreakBlocksListener.java | 1 + .../listeners/flags/BreedingListener.java | 1 + .../bskyblock/listeners/flags/BucketListener.java | 1 + .../bskyblock/listeners/flags/EggListener.java | 1 + .../listeners/flags/EnderChestListener.java | 1 + .../listeners/flags/EnterExitListener.java | 1 + .../listeners/flags/EntityInteractListener.java | 1 + .../bskyblock/listeners/flags/FireListener.java | 1 + .../bskyblock/listeners/flags/HurtingListener.java | 1 + .../listeners/flags/InventoryListener.java | 1 + .../flags/InvincibleVisitorsListener.java | 1 + .../listeners/flags/IslandRespawnListener.java | 1 + .../listeners/flags/ItemDropPickUpListener.java | 1 + .../bskyblock/listeners/flags/LeashListener.java | 1 + .../listeners/flags/MobSpawnListener.java | 1 + .../bskyblock/listeners/flags/PVPListener.java | 1 + .../flags/PhysicalInteractionListener.java | 1 + .../listeners/flags/PistonPushListener.java | 1 + .../listeners/flags/PlaceBlocksListener.java | 1 + .../bskyblock/listeners/flags/PortalListener.java | 1 + .../listeners/flags/RemoveMobsListener.java | 1 + .../listeners/flags/ShearingListener.java | 1 + .../listeners/flags/TeleportationListener.java | 1 + .../java/us/tastybento/bskyblock/lists/Flags.java | 4 ++-- .../bskyblock/managers/IslandWorldManager.java | 2 +- src/test/java/bskyblock/TestBSkyBlock.java | 2 +- .../bskyblock/listeners/flags/CycleClickTest.java | 2 +- .../flags/SettingsToggleClickListenerTest.java | 2 +- 34 files changed, 44 insertions(+), 16 deletions(-) rename src/main/java/us/tastybento/bskyblock/{listeners => api}/flags/AbstractFlagListener.java (95%) rename src/main/java/us/tastybento/bskyblock/{listeners => api}/flags/clicklisteners/CycleClick.java (97%) rename src/main/java/us/tastybento/bskyblock/{listeners => api}/flags/clicklisteners/IslandToggleClickListener.java (96%) rename src/main/java/us/tastybento/bskyblock/{listeners => api}/flags/clicklisteners/WorldToggleClickListener.java (96%) diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/AbstractFlagListener.java b/src/main/java/us/tastybento/bskyblock/api/flags/AbstractFlagListener.java similarity index 95% rename from src/main/java/us/tastybento/bskyblock/listeners/flags/AbstractFlagListener.java rename to src/main/java/us/tastybento/bskyblock/api/flags/AbstractFlagListener.java index 46698e98c..9941baa50 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/AbstractFlagListener.java +++ b/src/main/java/us/tastybento/bskyblock/api/flags/AbstractFlagListener.java @@ -1,4 +1,4 @@ -package us.tastybento.bskyblock.listeners.flags; +package us.tastybento.bskyblock.api.flags; import java.lang.reflect.Method; import java.util.Optional; @@ -10,8 +10,6 @@ import org.bukkit.event.Event; import org.bukkit.event.Listener; import us.tastybento.bskyblock.BSkyBlock; -import us.tastybento.bskyblock.api.flags.Flag; -import us.tastybento.bskyblock.api.flags.Flag.Type; import us.tastybento.bskyblock.api.localization.TextVariables; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.database.objects.Island; @@ -131,7 +129,7 @@ public abstract class AbstractFlagListener implements Listener { // Get the island and if present Optional island = getIslands().getProtectedIslandAt(loc); // Handle Settings Flag - if (flag.getType().equals(Type.SETTING)) { + if (flag.getType().equals(Flag.Type.SETTING)) { // If the island exists, return the setting, otherwise return the default setting for this flag return island.map(x -> x.isAllowed(flag)).orElse(flag.isSetForWorld(loc.getWorld())); } @@ -146,6 +144,12 @@ public abstract class AbstractFlagListener implements Listener { return false; } + // Ops or bypass mods can do anything + if (user.isOp() || user.hasPermission(getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypassprotect")) { + user = null; + return true; + } + // Check if the plugin is set in User (required for testing) User.setPlugin(plugin); @@ -187,7 +191,7 @@ public abstract class AbstractFlagListener implements Listener { protected IslandsManager getIslands() { return plugin.getIslands(); } - + /** * Get the island world manager * @return Island World Manager diff --git a/src/main/java/us/tastybento/bskyblock/api/flags/FlagBuilder.java b/src/main/java/us/tastybento/bskyblock/api/flags/FlagBuilder.java index 9ed0b76b1..a99a3d626 100644 --- a/src/main/java/us/tastybento/bskyblock/api/flags/FlagBuilder.java +++ b/src/main/java/us/tastybento/bskyblock/api/flags/FlagBuilder.java @@ -4,8 +4,8 @@ import org.bukkit.Material; import org.bukkit.event.Listener; import us.tastybento.bskyblock.api.flags.Flag.Type; +import us.tastybento.bskyblock.api.flags.clicklisteners.CycleClick; import us.tastybento.bskyblock.api.panels.PanelItem; -import us.tastybento.bskyblock.listeners.flags.clicklisteners.CycleClick; import us.tastybento.bskyblock.managers.RanksManager; public class FlagBuilder { @@ -91,7 +91,7 @@ public class FlagBuilder { /** * Adds a listener for clicks on this flag when it is a panel item. Default is - * {@link us.tastybento.bskyblock.listeners.flags.clicklisteners.CycleClick} + * {@link us.tastybento.bskyblock.api.flags.clicklisteners.CycleClick} * @param onClickListener - the listener for clicks. Must use the ClickOn interface * @return FlagBuilder */ diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/CycleClick.java b/src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/CycleClick.java similarity index 97% rename from src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/CycleClick.java rename to src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/CycleClick.java index ab13c1823..297a1514d 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/CycleClick.java +++ b/src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/CycleClick.java @@ -1,4 +1,4 @@ -package us.tastybento.bskyblock.listeners.flags.clicklisteners; +package us.tastybento.bskyblock.api.flags.clicklisteners; import org.bukkit.Sound; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/IslandToggleClickListener.java b/src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/IslandToggleClickListener.java similarity index 96% rename from src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/IslandToggleClickListener.java rename to src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/IslandToggleClickListener.java index 736318ec4..1fb727587 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/IslandToggleClickListener.java +++ b/src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/IslandToggleClickListener.java @@ -1,7 +1,7 @@ /* */ -package us.tastybento.bskyblock.listeners.flags.clicklisteners; +package us.tastybento.bskyblock.api.flags.clicklisteners; import org.bukkit.Sound; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/WorldToggleClickListener.java b/src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/WorldToggleClickListener.java similarity index 96% rename from src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/WorldToggleClickListener.java rename to src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/WorldToggleClickListener.java index 71f8b0bec..f7a25bd14 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/clicklisteners/WorldToggleClickListener.java +++ b/src/main/java/us/tastybento/bskyblock/api/flags/clicklisteners/WorldToggleClickListener.java @@ -1,7 +1,7 @@ /* */ -package us.tastybento.bskyblock.listeners.flags.clicklisteners; +package us.tastybento.bskyblock.api.flags.clicklisteners; import org.bukkit.Sound; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/BlockInteractionListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/BlockInteractionListener.java index 499af61c8..7e14fe815 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/BlockInteractionListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/BlockInteractionListener.java @@ -5,6 +5,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/BreakBlocksListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/BreakBlocksListener.java index 4475ef94c..683e706d9 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/BreakBlocksListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/BreakBlocksListener.java @@ -17,6 +17,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.util.BlockIterator; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/BreedingListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/BreedingListener.java index 4437f1e02..c7e22e49b 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/BreedingListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/BreedingListener.java @@ -11,6 +11,7 @@ import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/BucketListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/BucketListener.java index 530bad340..6eacf763c 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/BucketListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/BucketListener.java @@ -7,6 +7,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.event.player.PlayerBucketFillEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/EggListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/EggListener.java index 391fb8742..1b97296e6 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/EggListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/EggListener.java @@ -4,6 +4,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerEggThrowEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/EnderChestListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/EnderChestListener.java index d78c03bc1..6a437cee0 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/EnderChestListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/EnderChestListener.java @@ -11,6 +11,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.player.PlayerInteractEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.localization.TextVariables; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/EnterExitListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/EnterExitListener.java index c7fae7157..35e4bd921 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/EnterExitListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/EnterExitListener.java @@ -10,6 +10,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.util.Vector; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/EntityInteractListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/EntityInteractListener.java index 7790dc686..f826b3665 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/EntityInteractListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/EntityInteractListener.java @@ -9,6 +9,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/FireListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/FireListener.java index 67162f603..29d2d0700 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/FireListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/FireListener.java @@ -16,6 +16,7 @@ import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.util.BlockIterator; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.flags.Flag; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/HurtingListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/HurtingListener.java index 0aa604dc7..05beec93f 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/HurtingListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/HurtingListener.java @@ -27,6 +27,7 @@ import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.potion.PotionEffect; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.flags.Flag; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/InventoryListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/InventoryListener.java index 767fd3767..755e7c1e7 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/InventoryListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/InventoryListener.java @@ -13,6 +13,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryClickEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/InvincibleVisitorsListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/InvincibleVisitorsListener.java index 845fdbdff..756420cc4 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/InvincibleVisitorsListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/InvincibleVisitorsListener.java @@ -15,6 +15,7 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.inventory.ClickType; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.panels.Panel; import us.tastybento.bskyblock.api.panels.PanelItem; import us.tastybento.bskyblock.api.panels.PanelItem.ClickHandler; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/IslandRespawnListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/IslandRespawnListener.java index dd1fbf007..0309bb8de 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/IslandRespawnListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/IslandRespawnListener.java @@ -14,6 +14,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerRespawnEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/ItemDropPickUpListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/ItemDropPickUpListener.java index 60500b668..9d70d7d66 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/ItemDropPickUpListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/ItemDropPickUpListener.java @@ -6,6 +6,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.player.PlayerDropItemEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/LeashListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/LeashListener.java index 5c9033cd9..6db8c7795 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/LeashListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/LeashListener.java @@ -7,6 +7,7 @@ import org.bukkit.event.entity.PlayerLeashEntityEvent; import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.event.player.PlayerUnleashEntityEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/MobSpawnListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/MobSpawnListener.java index 1b3e623de..6d130b64e 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/MobSpawnListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/MobSpawnListener.java @@ -10,6 +10,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/PVPListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/PVPListener.java index fe55ce5ea..c1dd7d8f8 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/PVPListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/PVPListener.java @@ -20,6 +20,7 @@ import org.bukkit.event.entity.LingeringPotionSplashEvent; import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.event.player.PlayerFishEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.flags.Flag; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/PhysicalInteractionListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/PhysicalInteractionListener.java index 265072af2..49ad3d6e9 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/PhysicalInteractionListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/PhysicalInteractionListener.java @@ -5,6 +5,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/PistonPushListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/PistonPushListener.java index c12598c4d..7fa745f4c 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/PistonPushListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/PistonPushListener.java @@ -7,6 +7,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockPistonExtendEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/PlaceBlocksListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/PlaceBlocksListener.java index ae2b8aa4a..e24b8b9a3 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/PlaceBlocksListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/PlaceBlocksListener.java @@ -11,6 +11,7 @@ import org.bukkit.event.block.EntityBlockFormEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.lists.Flags; diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/PortalListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/PortalListener.java index e8895d725..f9a30e73b 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/PortalListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/PortalListener.java @@ -5,6 +5,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/RemoveMobsListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/RemoveMobsListener.java index 8e6f2109a..7292312e1 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/RemoveMobsListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/RemoveMobsListener.java @@ -7,6 +7,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerTeleportEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/ShearingListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/ShearingListener.java index 136d8fc28..7e0b3acf0 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/ShearingListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/ShearingListener.java @@ -4,6 +4,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerShearEntityEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/listeners/flags/TeleportationListener.java b/src/main/java/us/tastybento/bskyblock/listeners/flags/TeleportationListener.java index 426a0d660..a9375049e 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/flags/TeleportationListener.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/flags/TeleportationListener.java @@ -5,6 +5,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; /** diff --git a/src/main/java/us/tastybento/bskyblock/lists/Flags.java b/src/main/java/us/tastybento/bskyblock/lists/Flags.java index a03cf8306..c570f3672 100644 --- a/src/main/java/us/tastybento/bskyblock/lists/Flags.java +++ b/src/main/java/us/tastybento/bskyblock/lists/Flags.java @@ -9,6 +9,8 @@ import org.bukkit.Material; import us.tastybento.bskyblock.api.flags.Flag; import us.tastybento.bskyblock.api.flags.Flag.Type; +import us.tastybento.bskyblock.api.flags.clicklisteners.IslandToggleClickListener; +import us.tastybento.bskyblock.api.flags.clicklisteners.WorldToggleClickListener; import us.tastybento.bskyblock.api.flags.FlagBuilder; import us.tastybento.bskyblock.listeners.flags.BlockInteractionListener; import us.tastybento.bskyblock.listeners.flags.BreakBlocksListener; @@ -34,8 +36,6 @@ import us.tastybento.bskyblock.listeners.flags.PortalListener; import us.tastybento.bskyblock.listeners.flags.RemoveMobsListener; import us.tastybento.bskyblock.listeners.flags.ShearingListener; import us.tastybento.bskyblock.listeners.flags.TeleportationListener; -import us.tastybento.bskyblock.listeners.flags.clicklisteners.IslandToggleClickListener; -import us.tastybento.bskyblock.listeners.flags.clicklisteners.WorldToggleClickListener; import us.tastybento.bskyblock.managers.RanksManager; public class Flags { diff --git a/src/main/java/us/tastybento/bskyblock/managers/IslandWorldManager.java b/src/main/java/us/tastybento/bskyblock/managers/IslandWorldManager.java index 938c1a82d..bef1566fa 100644 --- a/src/main/java/us/tastybento/bskyblock/managers/IslandWorldManager.java +++ b/src/main/java/us/tastybento/bskyblock/managers/IslandWorldManager.java @@ -452,7 +452,7 @@ public class IslandWorldManager { } /** - * Get the permission prefix for this world + * Get the permission prefix for this world. No trailing dot included. * @param world - world * @return permission prefix for this world */ diff --git a/src/test/java/bskyblock/TestBSkyBlock.java b/src/test/java/bskyblock/TestBSkyBlock.java index 7f4906085..a747e0543 100644 --- a/src/test/java/bskyblock/TestBSkyBlock.java +++ b/src/test/java/bskyblock/TestBSkyBlock.java @@ -53,11 +53,11 @@ import us.tastybento.bskyblock.Settings; import us.tastybento.bskyblock.api.commands.CompositeCommand; import us.tastybento.bskyblock.api.events.IslandBaseEvent; import us.tastybento.bskyblock.api.events.team.TeamEvent; +import us.tastybento.bskyblock.api.flags.AbstractFlagListener; import us.tastybento.bskyblock.api.flags.Flag; import us.tastybento.bskyblock.api.flags.FlagBuilder; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.database.objects.Island; -import us.tastybento.bskyblock.listeners.flags.AbstractFlagListener; import us.tastybento.bskyblock.lists.Flags; import us.tastybento.bskyblock.managers.CommandsManager; import us.tastybento.bskyblock.managers.FlagsManager; diff --git a/src/test/java/us/tastybento/bskyblock/listeners/flags/CycleClickTest.java b/src/test/java/us/tastybento/bskyblock/listeners/flags/CycleClickTest.java index 9fee4b85a..61c55e02c 100644 --- a/src/test/java/us/tastybento/bskyblock/listeners/flags/CycleClickTest.java +++ b/src/test/java/us/tastybento/bskyblock/listeners/flags/CycleClickTest.java @@ -31,12 +31,12 @@ import org.powermock.reflect.Whitebox; import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.Settings; import us.tastybento.bskyblock.api.flags.Flag; +import us.tastybento.bskyblock.api.flags.clicklisteners.CycleClick; import us.tastybento.bskyblock.api.panels.Panel; import us.tastybento.bskyblock.api.panels.PanelItem; import us.tastybento.bskyblock.api.user.Notifier; import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.database.objects.Island; -import us.tastybento.bskyblock.listeners.flags.clicklisteners.CycleClick; import us.tastybento.bskyblock.managers.FlagsManager; import us.tastybento.bskyblock.managers.IslandsManager; import us.tastybento.bskyblock.managers.LocalesManager; diff --git a/src/test/java/us/tastybento/bskyblock/listeners/flags/SettingsToggleClickListenerTest.java b/src/test/java/us/tastybento/bskyblock/listeners/flags/SettingsToggleClickListenerTest.java index c67d78462..f2b741b3d 100644 --- a/src/test/java/us/tastybento/bskyblock/listeners/flags/SettingsToggleClickListenerTest.java +++ b/src/test/java/us/tastybento/bskyblock/listeners/flags/SettingsToggleClickListenerTest.java @@ -20,10 +20,10 @@ import org.powermock.reflect.Whitebox; import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.api.flags.Flag; +import us.tastybento.bskyblock.api.flags.clicklisteners.WorldToggleClickListener; import us.tastybento.bskyblock.api.panels.Panel; import us.tastybento.bskyblock.api.panels.PanelItem; import us.tastybento.bskyblock.api.user.User; -import us.tastybento.bskyblock.listeners.flags.clicklisteners.WorldToggleClickListener; import us.tastybento.bskyblock.managers.FlagsManager; import us.tastybento.bskyblock.managers.IslandWorldManager; import us.tastybento.bskyblock.util.Util;