Retry CTF proxy fix

But this time, let's allow deregistration even if it hasn't been
registered by us, because it auto-registered itself
This commit is contained in:
samczsun 2016-11-17 21:10:38 -05:00 committed by Shaun Bennett
parent 3d5e61e0f1
commit 67a663891e

View File

@ -189,6 +189,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;
@ -1709,40 +1710,43 @@ public class ArcadeManager extends MiniPlugin implements IRelation
public void enableChampionsModules()
{
_classManager.setEnabled(true);
_classShopManager.registerSelf();
_skillFactory.registerSelf();
_itemFactory.registerSelf();
_energy.registerSelf();
_eloManager.registerSelf();
if (_registered == null || !_registered)
{
_classManager.setEnabled(true);
_classShopManager.registerSelf();
_skillFactory.registerSelf();
_itemFactory.registerSelf();
_energy.registerSelf();
_eloManager.registerSelf();
//Class Shop
_plugin.getServer().getPluginManager().registerEvents(_classShop, _plugin);
//Class Shop
_plugin.getServer().getPluginManager().registerEvents(_classShop, _plugin);
_registered = true;
}
}
public void disableChampionsModules()
{
_classManager.setEnabled(false);
_classShopManager.deregisterSelf();
_skillFactory.deregisterSelf();
_itemFactory.deregisterSelf();
_energy.deregisterSelf();
_eloManager.deregisterSelf();
if (_registered == null || _registered)
{
_classManager.setEnabled(false);
_classShopManager.deregisterSelf();
_skillFactory.deregisterSelf();
_itemFactory.deregisterSelf();
_energy.deregisterSelf();
_eloManager.deregisterSelf();
//Class Shop
HandlerList.unregisterAll(_classShop);
//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;