From c814fc73f70005f51957c58af2ae0263a04072d3 Mon Sep 17 00:00:00 2001 From: phobia Date: Fri, 29 Apr 2016 12:53:20 +1000 Subject: [PATCH] Uncommented ClansBanManager's instances --- .../src/mineplex/game/clans/Clans.java | 4 +-- .../game/clans/clans/ClansManager.java | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index 15e9c9edc..7f15cbfbe 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -113,7 +113,7 @@ public class Clans extends JavaPlugin Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName()); new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); -// ClansBanManager clansBans = new ClansBanManager(this, _clientManager, _donationManager); + ClansBanManager clansBans = new ClansBanManager(this, _clientManager, _donationManager); Punish punish = new Punish(this, webServerAddress, _clientManager); AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager); @@ -144,7 +144,7 @@ public class Clans extends JavaPlugin GearManager customGear = new GearManager(this, packetHandler, _clientManager, _donationManager); HologramManager hologram = new HologramManager(this, packetHandler); - _clansManager = new ClansManager(this, /*clansBans,*/ serverStatusManager.getCurrentServerName(), incognito, packetHandler, punish, _clientManager, _donationManager, preferenceManager, blockRestore, statsManager, teleport, chat, customGear, hologram, webServerAddress); + _clansManager = new ClansManager(this, clansBans, serverStatusManager.getCurrentServerName(), incognito, packetHandler, punish, _clientManager, _donationManager, preferenceManager, blockRestore, statsManager, teleport, chat, customGear, hologram, webServerAddress); new Recipes(this); new Farming(this); new BuildingShop(_clansManager, _clientManager, _donationManager); 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 6d433d3ae..a37b131d3 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 @@ -10,6 +10,7 @@ import java.util.TimeZone; import java.util.UUID; import mineplex.core.recharge.Recharge; +import mineplex.game.clans.clans.ban.ClansBanManager; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -224,19 +225,19 @@ public class ClansManager extends MiniClientPluginimplements IRelati public String UserDataDir = UtilServer.getServer().getWorlds().get(0).getWorldFolder().getPath() + File.separator + ".." + File.separator + "CLANS_USER_DATA" + File.separator; - /*private ClansBanManager _clansBans;*/ + private ClansBanManager _clansBans; public ClanTips ClanTips; // Spawn area - public ClansManager(JavaPlugin plugin/*, ClansBanManager clansBans*/, String serverName, IncognitoManager incognitoManager, PacketHandler packetHandler, Punish punish, CoreClientManager clientManager, DonationManager donationManager, PreferencesManager preferencesManager, BlockRestore blockRestore, StatsManager statsManager, Teleport teleport, Chat chat, GearManager gearManager, HologramManager hologramManager, String webServerAddress) + public ClansManager(JavaPlugin plugin, ClansBanManager clansBans, String serverName, IncognitoManager incognitoManager, PacketHandler packetHandler, Punish punish, CoreClientManager clientManager, DonationManager donationManager, PreferencesManager preferencesManager, BlockRestore blockRestore, StatsManager statsManager, Teleport teleport, Chat chat, GearManager gearManager, HologramManager hologramManager, String webServerAddress) { super("Clans Manager", plugin); _instance = this; - /*_clansBans = clansBans;*/ + _clansBans = clansBans; _punish = punish; _incognitoManager = incognitoManager; @@ -602,21 +603,21 @@ public class ClansManager extends MiniClientPluginimplements IRelati { event.setJoinMessage(null); - /*if (_clansBans.willBeKicked(event.getPlayer())) - { + if (_clansBans.willBeKicked(event.getPlayer())) + { return; - }*/ + } if (_incognitoManager.Get(event.getPlayer()).Status) { return; } - /*_clansBans.runAfterLoad(event.getPlayer().getName(), () -> { + _clansBans.runAfterLoad(event.getPlayer().getName(), () -> { if (_clansBans.Get(event.getPlayer().getName()).isBanned()) { return; - }*/ + } for (Player other : UtilServer.getPlayers()) { @@ -628,7 +629,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati other.sendMessage(F.sys("Join", event.getPlayer().getName())); } - /*});*/ + }); } @EventHandler(priority = EventPriority.HIGHEST) @@ -641,10 +642,10 @@ public class ClansManager extends MiniClientPluginimplements IRelati return; } - /*if (_clansBans.willBeKicked(event.getPlayer())) + if (_clansBans.willBeKicked(event.getPlayer())) { return; - }*/ + } for (Player other : UtilServer.getPlayers()) { @@ -667,10 +668,10 @@ public class ClansManager extends MiniClientPluginimplements IRelati return; } - /*if (_clansBans.willBeKicked(event.getPlayer())) + if (_clansBans.willBeKicked(event.getPlayer())) { return; - }*/ + } if (event.getReason().contains("You are banned from Clans")) {