Uncommented ClansBanManager's instances

This commit is contained in:
phobia 2016-04-29 12:53:20 +10:00
parent b21939444c
commit c814fc73f7
2 changed files with 16 additions and 15 deletions

View File

@ -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);

View File

@ -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 MiniClientPlugin<ClientClan>implements 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 MiniClientPlugin<ClientClan>implements 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 MiniClientPlugin<ClientClan>implements IRelati
other.sendMessage(F.sys("Join", event.getPlayer().getName()));
}
/*});*/
});
}
@EventHandler(priority = EventPriority.HIGHEST)
@ -641,10 +642,10 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements 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 MiniClientPlugin<ClientClan>implements IRelati
return;
}
/*if (_clansBans.willBeKicked(event.getPlayer()))
if (_clansBans.willBeKicked(event.getPlayer()))
{
return;
}*/
}
if (event.getReason().contains("You are banned from Clans"))
{