From 7da8b8e3bf9c2565ff180053d1604823bb689a4c Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Thu, 26 Nov 2015 05:29:35 +0000 Subject: [PATCH] fix players hurting each other in safe zones --- .../src/mineplex/game/clans/gameplay/Gameplay.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java index 06b4ba957..30aa72a9e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java @@ -91,6 +91,15 @@ public class Gameplay extends MiniPlugin Bukkit.getPluginManager().registerEvents(new CustomCreatures(), plugin); } + @EventHandler(priority = EventPriority.LOWEST) + public void spawnDamage(CustomDamageEvent event) + { + if (_clansManager.getClanUtility().getClaim(event.GetDamageeEntity().getLocation()) != null && _clansManager.getClanUtility().getClaim(event.GetDamageeEntity().getLocation()).Safe) + { + event.SetCancelled("Safe Zone"); + } + } + @EventHandler public void onPlayerFishing(PlayerFishEvent event) {