Merge remote-tracking branch 'refs/remotes/origin/develop' into update/uhc-moppletop

This commit is contained in:
Sam 2016-11-17 21:20:28 +00:00
commit 0ca79f193f
2 changed files with 27 additions and 34 deletions

View File

@ -39,8 +39,6 @@ public class PowerPlayClubRepository implements Listener {
// giving a player his/her rewards.
private final Map<UUID, PowerPlayData> _cachedPlayerData = new HashMap<>();
private final Set<UUID> _yearlySubscriptions = new HashSet<>();
private final CoreClientManager _clientManager;
private final DonationManager _donationManager;
@ -86,10 +84,6 @@ public class PowerPlayClubRepository implements Listener {
LocalDate date = resultSet.getDate("startDate").toLocalDate();
PowerPlayData.SubscriptionDuration duration = PowerPlayData.SubscriptionDuration.valueOf(resultSet.getString("duration").toUpperCase());
subscriptions.add(new PowerPlayData.Subscription(date, duration));
if (duration.equals(PowerPlayData.SubscriptionDuration.YEAR))
{
_yearlySubscriptions.add(uuid);
}
}
// Now that we have the claims from the first processor and subscriptions from this one, combine them
@ -115,7 +109,10 @@ public class PowerPlayClubRepository implements Listener {
.forEach(_donationManager.Get(player)::AddUnknownSalesPackagesOwned);
// Gives Metal Man for anyone subscribed
_donationManager.Get(player).AddUnknownSalesPackagesOwned("Metal Man Morph");
if (cached.getUsableCosmeticMonths().size() > 0)
{
_donationManager.Get(player).AddUnknownSalesPackagesOwned("Metal Man Morph");
}
}
@EventHandler
@ -123,7 +120,6 @@ public class PowerPlayClubRepository implements Listener {
{
_stageOneDataClaims.remove(event.getPlayer().getUniqueId()); // Just in case.
_cachedPlayerData.remove(event.getPlayer().getUniqueId());
_yearlySubscriptions.remove(event.getPlayer().getUniqueId());
}
public CompletableFuture<Void> addSubscription(int accountId, LocalDate date, String duration)

View File

@ -185,8 +185,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private ArcadeShop _arcadeShop;
//Champions Modules
private boolean _enabled = false;
private Boolean _registered = null;
private boolean _enabled = true;
private ClassManager _classManager;
private SkillFactory _skillFactory;
private ItemFactory _itemFactory;
@ -1697,43 +1697,40 @@ public class ArcadeManager extends MiniPlugin implements IRelation
public void enableChampionsModules()
{
if (_registered == null || !_registered)
{
_classManager.setEnabled(true);
_classShopManager.registerSelf();
_skillFactory.registerSelf();
_itemFactory.registerSelf();
_energy.registerSelf();
_eloManager.registerSelf();
_classManager.setEnabled(true);
_classShopManager.registerSelf();
_skillFactory.registerSelf();
_itemFactory.registerSelf();
_energy.registerSelf();
_eloManager.registerSelf();
//Class Shop
_plugin.getServer().getPluginManager().registerEvents(_classShop, _plugin);
_registered = true;
}
//Class Shop
_plugin.getServer().getPluginManager().registerEvents(_classShop, _plugin);
}
public void disableChampionsModules()
{
if (_registered != null && _registered)
{
_classManager.setEnabled(false);
_classShopManager.deregisterSelf();
_skillFactory.deregisterSelf();
_itemFactory.deregisterSelf();
_energy.deregisterSelf();
_eloManager.deregisterSelf();
_classManager.setEnabled(false);
_classShopManager.deregisterSelf();
_skillFactory.deregisterSelf();
_itemFactory.deregisterSelf();
_energy.deregisterSelf();
_eloManager.deregisterSelf();
//Class Shop
HandlerList.unregisterAll(_classShop);
_registered = false;
}
//Class Shop
HandlerList.unregisterAll(_classShop);
}
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;