1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-19 10:22:58 +01:00

Added toggle to disable party system

This commit is contained in:
nossr50
2019-03-18 07:46:33 -07:00
parent b0b326d080
commit 3a21a913c6
6 changed files with 55 additions and 8 deletions

View File

@@ -137,7 +137,8 @@ public class mcMMO extends JavaPlugin {
registerCoreSkills();
registerCustomRecipes();
PartyManager.loadParties();
if(getConfigManager().getConfigParty().isPartySystemEnabled())
PartyManager.loadParties();
formulaManager = new FormulaManager();
holidayManager = new HolidayManager();
@@ -499,16 +500,21 @@ public class mcMMO extends JavaPlugin {
new UserPurgeTask().runTaskTimerAsynchronously(this, purgeIntervalTicks, purgeIntervalTicks);
}
// Automatically remove old members from parties
long kickIntervalTicks = getConfigManager().getConfigParty().getPartyCleanup().getPartyAutoKickHoursInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
//Party System Stuff
if(mcMMO.configManager.getConfigParty().isPartySystemEnabled())
{
// Automatically remove old members from parties
long kickIntervalTicks = getConfigManager().getConfigParty().getPartyCleanup().getPartyAutoKickHoursInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
if (kickIntervalTicks == 0) {
new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
}
else if (kickIntervalTicks > 0) {
new PartyAutoKickTask().runTaskTimer(this, kickIntervalTicks, kickIntervalTicks);
if (kickIntervalTicks == 0) {
new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
}
else if (kickIntervalTicks > 0) {
new PartyAutoKickTask().runTaskTimer(this, kickIntervalTicks, kickIntervalTicks);
}
}
// Update power level tag scoreboards
new PowerLevelUpdatingTask().runTaskTimer(this, 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);