diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index d099eb34a..9eb461531 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -608,7 +608,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati player.getInventory().setHelmet(null); runSyncLater(() -> { player.getInventory().setHelmet(helmet); - }, 5L); + }, 20L); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverManager.java index 7e84a14af..3c9b12958 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverManager.java @@ -10,6 +10,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; +import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerInteractEvent; @@ -106,6 +107,17 @@ public class ObserverManager extends MiniPlugin } } + @EventHandler + public void onBreak(BlockBreakEvent event) + { + ObserverData data = _observerMap.get(event.getPlayer()); + + if (data != null) + { + if (!data.getSettings().contains(ObserverSettings.CAN_BREAK_BLOCKS)) + event.setCancelled(true); + } } + @EventHandler public void onInventoryClick(InventoryClickEvent event) { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverSettings.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverSettings.java index b06c62e3c..08c0628a1 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverSettings.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/observer/ObserverSettings.java @@ -16,7 +16,7 @@ public enum ObserverSettings public static EnumSet getSettings(Rank rank) { if (rank.has(Rank.DEVELOPER)) - return EnumSet.of(CAN_OPEN_CHESTS); + return EnumSet.of(CAN_OPEN_CHESTS, CAN_BREAK_BLOCKS); return EnumSet.noneOf(ObserverSettings.class); }