Attempt to fix CTF Proxies (#280)

This commit is contained in:
Sam Sun 2016-11-16 21:40:42 -05:00 committed by Shaun Bennett
parent 735550c157
commit 4709161180

View File

@ -190,6 +190,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
//Champions Modules
private boolean _enabled = true;
private Boolean _registered = null;
private ClassManager _classManager;
private SkillFactory _skillFactory;
private ItemFactory _itemFactory;
@ -1722,6 +1723,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
}
public void enableChampionsModules()
{
if (_registered == null || !_registered)
{
_classManager.setEnabled(true);
_classShopManager.registerSelf();
@ -1732,9 +1735,14 @@ public class ArcadeManager extends MiniPlugin implements IRelation
//Class Shop
_plugin.getServer().getPluginManager().registerEvents(_classShop, _plugin);
_registered = true;
}
}
public void disableChampionsModules()
{
if (_registered != null && _registered)
{
_classManager.setEnabled(false);
_classShopManager.deregisterSelf();
@ -1745,18 +1753,14 @@ public class ArcadeManager extends MiniPlugin implements IRelation
//Class Shop
HandlerList.unregisterAll(_classShop);
_registered = false;
}
}
public void toggleChampionsModules(GameType gameType)
{
boolean isChamps = gameType == GameType.ChampionsDominate || gameType == GameType.ChampionsTDM || gameType == GameType.ChampionsCTF || gameType == GameType.BossBattles;
if (_enabled == isChamps)
{
System.out.println("----------Champions Modules are still " + isChamps);
return;
}
System.out.println("----------Champions Modules set to " + isChamps);
_enabled = isChamps;