diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java index 9f20b5ec9..e5dd03b0b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java @@ -480,7 +480,7 @@ public class ClanInfo public boolean isOnline() { - return isOnlineNow();// || System.currentTimeMillis() - _lastOnline.getTime() < Clans.getOnlineTime(); + return isOnlineNow(); } public String getProtected() @@ -489,7 +489,7 @@ public class ClanInfo if (cur.isOnline()) return C.cRed + "No - Clan Members are Online"; - if (System.currentTimeMillis() - _lastOnline.getTime() > Clans.getOnlineTime()) + if (UtilTime.elapsed(_lastOnline.getTime(), Clans.getOnlineTime())) return C.cGreen + "Yes - Clan Members are Offline"; return C.cGold @@ -498,6 +498,10 @@ public class ClanInfo TimeUnit.FIT) + " to Protection"; } + public boolean isProtected() { + return getProtected().startsWith(C.cGreen + "Yes"); + } + public TntGenerator getGenerator() { return _generator; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java index 9db1f9d2e..b1e198995 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java @@ -263,7 +263,7 @@ public class ClansGame extends MiniPlugin { // Cancel event.SetCancelled("Clans Ally"); - + // Inform if (damager != null) { @@ -520,8 +520,9 @@ public class ClansGame extends MiniPlugin { ClanInfo clan = _clans.getClanUtility().getClanByPlayer(event.getPlayer()); if (clan == null) return; - - clan.setLastOnline(new Timestamp(System.currentTimeMillis())); + + if(!clan.isOnline()) clan.setLastOnline(new Timestamp(System.currentTimeMillis())); //Noone else on + else clan.setLastOnline(new Timestamp(0)); } @EventHandler(priority = EventPriority.LOWEST) @@ -538,14 +539,14 @@ public class ClansGame extends MiniPlugin ClanInfo clan = _clans.getClanUtility().getOwner(event.getEntity().getLocation()); if (clan == null) return; - + if (_clans.getWarManager().isBeingInvaded(clan)) { // Allow because of invasion return; } - if (!clan.isOnline()) + if (!clan.isProtected()) event.setCancelled(true); else clan.inform(C.cRed + "Your Territory is under attack!", null); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/attributes/AttackAttribute.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/attributes/AttackAttribute.java index 836665064..58f115f2d 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/attributes/AttackAttribute.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/attributes/AttackAttribute.java @@ -30,6 +30,7 @@ public abstract class AttackAttribute extends ItemAttribute @Override public void onAttack(CustomDamageEvent event) { + if(event.GetCancellers().contains("Safe Zone")) return; _attackCount++; System.out.println("Attack count " + _attackCount + " - " + _attackLimit); if (_attackCount >= _attackLimit)