Uncommented ClansBanManager's instances

This commit is contained in:
phobia 2016-04-29 12:53:20 +10:00 committed by cnr
parent f1c2e71d56
commit 890ab9f67e
2 changed files with 17 additions and 15 deletions

View File

@ -41,6 +41,7 @@ import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater; import mineplex.core.updater.Updater;
import mineplex.core.visibility.VisibilityManager; import mineplex.core.visibility.VisibilityManager;
import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.ClansManager;
import mineplex.game.clans.clans.ban.ClansBanManager;
import mineplex.game.clans.items.GearManager; import mineplex.game.clans.items.GearManager;
import mineplex.game.clans.shop.building.BuildingShop; import mineplex.game.clans.shop.building.BuildingShop;
import mineplex.game.clans.shop.farming.FarmingShop; import mineplex.game.clans.shop.farming.FarmingShop;
@ -112,7 +113,7 @@ public class Clans extends JavaPlugin
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName()); Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); 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); Punish punish = new Punish(this, webServerAddress, _clientManager);
AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager); AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager);
@ -144,7 +145,7 @@ public class Clans extends JavaPlugin
GearManager customGear = new GearManager(this, packetHandler, _clientManager, _donationManager); GearManager customGear = new GearManager(this, packetHandler, _clientManager, _donationManager);
HologramManager hologram = new HologramManager(this, packetHandler); 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 Recipes(this);
new Farming(this); new Farming(this);
new BuildingShop(_clansManager, _clientManager, _donationManager); new BuildingShop(_clansManager, _clientManager, _donationManager);

View File

@ -81,6 +81,7 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.game.clans.Clans; import mineplex.game.clans.Clans;
import mineplex.game.clans.clans.ClanTips.TipType; import mineplex.game.clans.clans.ClanTips.TipType;
import mineplex.game.clans.clans.ClansUtility.ClanRelation; import mineplex.game.clans.clans.ClansUtility.ClanRelation;
import mineplex.game.clans.clans.ban.ClansBanManager;
import mineplex.game.clans.clans.commands.ClanManagementCommand; import mineplex.game.clans.clans.commands.ClanManagementCommand;
import mineplex.game.clans.clans.commands.ClansAllyChatCommand; import mineplex.game.clans.clans.commands.ClansAllyChatCommand;
import mineplex.game.clans.clans.commands.ClansChatCommand; import mineplex.game.clans.clans.commands.ClansChatCommand;
@ -226,19 +227,19 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
public String UserDataDir = UtilServer.getServer().getWorlds().get(0).getWorldFolder().getPath() + File.separator + ".." + File.separator + "CLANS_USER_DATA" + File.separator; 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; public ClanTips ClanTips;
// Spawn area // 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); super("Clans Manager", plugin);
_instance = this; _instance = this;
/*_clansBans = clansBans;*/ _clansBans = clansBans;
_punish = punish; _punish = punish;
_incognitoManager = incognitoManager; _incognitoManager = incognitoManager;
@ -605,21 +606,21 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
{ {
event.setJoinMessage(null); event.setJoinMessage(null);
/*if (_clansBans.willBeKicked(event.getPlayer())) if (_clansBans.willBeKicked(event.getPlayer()))
{ {
return; return;
}*/ }
if (_incognitoManager.Get(event.getPlayer()).Status) if (_incognitoManager.Get(event.getPlayer()).Status)
{ {
return; return;
} }
/*_clansBans.runAfterLoad(event.getPlayer().getName(), () -> { _clansBans.runAfterLoad(event.getPlayer().getName(), () -> {
if (_clansBans.Get(event.getPlayer().getName()).isBanned()) if (_clansBans.Get(event.getPlayer().getName()).isBanned())
{ {
return; return;
}*/ }
for (Player other : UtilServer.getPlayers()) for (Player other : UtilServer.getPlayers())
{ {
@ -631,7 +632,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
other.sendMessage(F.sys("Join", event.getPlayer().getName())); other.sendMessage(F.sys("Join", event.getPlayer().getName()));
} }
/*});*/ });
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
@ -644,10 +645,10 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
return; return;
} }
/*if (_clansBans.willBeKicked(event.getPlayer())) if (_clansBans.willBeKicked(event.getPlayer()))
{ {
return; return;
}*/ }
for (Player other : UtilServer.getPlayers()) for (Player other : UtilServer.getPlayers())
{ {
@ -670,10 +671,10 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
return; return;
} }
/*if (_clansBans.willBeKicked(event.getPlayer())) if (_clansBans.willBeKicked(event.getPlayer()))
{ {
return; return;
}*/ }
if (event.getReason().contains("You are banned from Clans")) if (event.getReason().contains("You are banned from Clans"))
{ {