From 1198426d8dddbe625a6cfd7453739ac1867aeefa Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sun, 23 Nov 2014 05:08:33 -0800 Subject: [PATCH] Little more work on Clans. --- .../game/clans/clans/ClansManager.java | 59 ++++++------------- 1 file changed, 18 insertions(+), 41 deletions(-) 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 f52fcb792..abc44c840 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 @@ -37,6 +37,7 @@ import mineplex.core.creature.event.CreatureSpawnCustomEvent; import mineplex.core.teleport.Teleport; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.game.clans.clans.ClansUtility.ClanRelation; import mineplex.game.clans.clans.repository.ClanTerritory; import mineplex.minecraft.game.core.combat.CombatManager; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -126,9 +127,6 @@ public class ClansManager extends MiniClientPlugin @EventHandler public void Update(UpdateEvent event) { - if (event.getType() == UpdateType.SEC) - Power(); - if (event.getType() == UpdateType.FAST) CGame().UpdateSafe(); @@ -184,7 +182,7 @@ public class ClansManager extends MiniClientPlugin @EventHandler(priority = EventPriority.HIGHEST) public void BlockCreatureSpawn(CreatureSpawnCustomEvent event) { - ClansClan clan = Clans().CUtil().getOwner(event.GetLocation()); + ClansClan clan = _clanUtility.getOwner(event.GetLocation()); if (clan != null) if (!clan.IsAdmin() && !clan.GetName().equals("Spawn")) @@ -263,18 +261,18 @@ public class ClansManager extends MiniClientPlugin public boolean HandleClanChat(AsyncPlayerChatEvent event, String filteredMessage) { - CoreClient client = Clients().Get(event.getPlayer()); + ClientClan client = Get(event.getPlayer()); if (client == null) return false; - if (!client.Clan().IsClanChat()) + if (!client.isClanChat()) return false; - ClansClan clan = CUtil().getClanByPlayer(event.getPlayer()); + ClanInfo clan = _clanUtility.getClanByPlayer(event.getPlayer()); if (clan == null) { - Clients().Get(event.getPlayer()).Clan().SetClanChat(false); + Get(event.getPlayer()).setClanChat(false); return false; } @@ -287,10 +285,10 @@ public class ClansManager extends MiniClientPlugin if (!Get(event.getPlayer()).isAllyChat()) return false; - ClansClan clan = CUtil().getClanByPlayer(event.getPlayer()); + ClanInfo clan = _clanUtility.getClanByPlayer(event.getPlayer()); if (clan == null) { - Clients().Get(event.getPlayer()).Clan().SetAllyChat(false); + Get(event.getPlayer()).setAllyChat(false); return false; } @@ -331,59 +329,38 @@ public class ClansManager extends MiniClientPlugin return _reclaimTime; } - @Override - public boolean CanHurt(Player a, Player b) + public boolean canHurt(Player a, Player b) { if (a.equals(b)) return false; - return CUtil().canHurt(a, b); + return _clanUtility.canHurt(a, b); } - @Override - public boolean CanHurt(String a, String b) + public boolean canHurt(String a, String b) { if (a.equals(b)) return false; - return CUtil().canHurt(UtilPlayer.searchExact(a), UtilPlayer.searchExact(b)); + return _clanUtility.canHurt(UtilPlayer.searchExact(a), UtilPlayer.searchExact(b)); } - @Override - public boolean IsSafe(Player a) + public boolean isSafe(Player a) { - return CUtil().isSafe(a); + return _clanUtility.isSafe(a); } - public IRepository GetRepository() { - return _repository; - } - - public void SetRepository(IRepository _repository) { - this._repository = _repository; - } - - public HashMap GetClanMemberMap() + public ClanRelation getRelation(String playerA, String playerB) { - return _clanMemberMap; - } - - public ClanRelation GetRelation(String playerA, String playerB) - { - return Clients().Get(playerA).Clan().GetRelation(playerB); + return Get(playerA).getRelation(playerB); } @Override public ChatColor GetColorOfFor(String other, Player player) { - return CUtil().relChatColor(Clients().Get(player).Clan().GetRelation(other), false); + return _clanUtility.relChatColor(Get(player).getRelation(other), false); } - - public String GetServerName() - { - return _serverName; - } - + public long getOnlineTime() { return _onlineTime;