mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 13:14:44 +02:00
Wire up Party Config pt 2
This commit is contained in:
@ -5,6 +5,7 @@ import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
import org.bukkit.Material;
|
||||
@ -329,7 +330,7 @@ public class MainConfig extends ConfigValidated {
|
||||
}
|
||||
|
||||
/* PARTY SETTINGS */
|
||||
if (getAutoPartyKickInterval() < -1) {
|
||||
/*if (getAutoPartyKickInterval() < -1) {
|
||||
reason.add(PARTY + "." + AUTO_KICK_INTERVAL + " should be at least -1!");
|
||||
}
|
||||
|
||||
@ -351,17 +352,17 @@ public class MainConfig extends ConfigValidated {
|
||||
|
||||
if (getPartyShareRange() <= 0) {
|
||||
reason.add(PARTY + "." + SHARING + "." + RANGE + " should be greater than 0!");
|
||||
}
|
||||
}*/
|
||||
|
||||
if (getPartyXpCurveMultiplier() < 1) {
|
||||
/*if (getPartyXpCurveMultiplier() < 1) {
|
||||
reason.add(PARTY + "." + LEVELING + "." + XP_CURVE_MODIFIER + " should be at least 1!");
|
||||
}
|
||||
|
||||
for (PartyFeature partyFeature : PartyFeature.values()) {
|
||||
if (getPartyFeatureUnlockLevel(partyFeature) < 0) {
|
||||
if (PartyManager. < 0) {
|
||||
reason.add(PARTY + "." + LEVELING + "." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
/* Inspect command distance */
|
||||
if (getInspectDistance() <= 0) {
|
||||
@ -697,23 +698,6 @@ public class MainConfig extends ConfigValidated {
|
||||
|
||||
/* PARTY SETTINGS */
|
||||
|
||||
//TODO: Move this to Experience Config
|
||||
public int getPartyXpCurveMultiplier() {
|
||||
return getIntValue(PARTY, LEVELING, XP_CURVE_MODIFIER);
|
||||
}
|
||||
|
||||
public boolean getPartyXpNearMembersNeeded() {
|
||||
return getBooleanValue(PARTY, LEVELING, NEAR_MEMBERS_NEEDED);
|
||||
}
|
||||
|
||||
public boolean getPartyInformAllMembers() {
|
||||
return getBooleanValue(PARTY, LEVELING, INFORM_ALL_PARTY_MEMBERS_ON_LEVEL_UP);
|
||||
}
|
||||
|
||||
public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) {
|
||||
return getIntValue(PARTY, LEVELING, StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + UNLOCK_LEVEL);
|
||||
}
|
||||
|
||||
/* Party Teleport Settings */
|
||||
public int getPTPCommandCooldown() {
|
||||
return getIntValue(COMMANDS, PTP, COOLDOWN);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.config.hocon.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.google.common.collect.Maps;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ -21,8 +22,25 @@ public class ConfigSectionPartyLevel {
|
||||
PARTY_FEATURE_MAP_DEFAULT.put(PartyFeature.CHAT, 1);
|
||||
}
|
||||
|
||||
@Setting(value = "Party-XP-Rate-Multiplier")
|
||||
private int partyXpCurveMultiplier = 3;
|
||||
/*
|
||||
int base = ExperienceConfig.getInstance().getBase(FormulaType.EXPONENTIAL);
|
||||
double multiplier = ExperienceConfig.getInstance().getMultiplier(FormulaType.EXPONENTIAL);
|
||||
double exponent = ExperienceConfig.getInstance().getExponent(FormulaType.EXPONENTIAL);
|
||||
|
||||
if (!experienceNeededExponential.containsKey(level)) {
|
||||
experience = (int) Math.floor((multiplier * Math.pow(level, exponent) + base));
|
||||
experience *= mcMMO.getConfigManager().getConfigParty().getPartyXP().getPartyLevel().getPartyXpCurveMultiplier();
|
||||
experienceNeededExponential.put(level, experience);
|
||||
}
|
||||
*/
|
||||
|
||||
@Setting(value = "Party-XP-Formula-Multiplier",
|
||||
comment = "The Party XP Formula is borrowed from the Player XP formula to help determine the amount of XP needed to level the party." +
|
||||
"\nThe Party XP Formula used to be based on your settings for player XP formula but I have separated it from those settings." +
|
||||
"\nThe Party XP Curve Multiplier takes the final result of calculating one level of XP and multiplies it by this value to get the amount of XP needed to level the party." +
|
||||
"\nParty Leveling used to have a level cap, I have removed this level cap as part of a feature request. It seems fun to level up parties indefinitely." +
|
||||
"\nParty Leveling is now using exponential level scaling by default.")
|
||||
private int partyXpCurveMultiplier = 10;
|
||||
|
||||
@Setting(value = "Party-Leveling-Requires-Nearby-Party-Members")
|
||||
private boolean partyLevelingNeedsNearbyMembers = true;
|
||||
@ -33,10 +51,6 @@ public class ConfigSectionPartyLevel {
|
||||
@Setting(value = "Party-Feature-Unlock-Level-Requirements")
|
||||
private Map<PartyFeature, Integer> partyFeatureUnlockMap = PARTY_FEATURE_MAP_DEFAULT;
|
||||
|
||||
public static HashMap<PartyFeature, Integer> getPartyFeatureMapDefault() {
|
||||
return PARTY_FEATURE_MAP_DEFAULT;
|
||||
}
|
||||
|
||||
public int getPartyXpCurveMultiplier() {
|
||||
return partyXpCurveMultiplier;
|
||||
}
|
||||
@ -49,7 +63,7 @@ public class ConfigSectionPartyLevel {
|
||||
return informPartyMembersOnLevelup;
|
||||
}
|
||||
|
||||
public Map<PartyFeature, Integer> getPartyFeatureUnlockMap() {
|
||||
return partyFeatureUnlockMap;
|
||||
public HashMap<PartyFeature, Integer> getPartyFeatureUnlockMap() {
|
||||
return Maps.newHashMap(partyFeatureUnlockMap);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user