mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-02-16 13:41:40 +01:00
Fixed party exp splitting + new option
This commit is contained in:
parent
4ae7fa4387
commit
9e8daf4842
@ -783,7 +783,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
* If it's null, no hologram will be displayed
|
* If it's null, no hologram will be displayed
|
||||||
* @param splitExp Should the exp be split among party members
|
* @param splitExp Should the exp be split among party members
|
||||||
*/
|
*/
|
||||||
public void giveExperience(double value, EXPSource source, @Nullable Location hologramLocation, boolean splitExp) {
|
public void giveExperience(double value, @NotNull EXPSource source, @Nullable Location hologramLocation, boolean splitExp) {
|
||||||
if (value <= 0) {
|
if (value <= 0) {
|
||||||
experience = Math.max(0, experience + value);
|
experience = Math.max(0, experience + value);
|
||||||
return;
|
return;
|
||||||
@ -791,10 +791,10 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
|
|
||||||
// Splitting exp through party members
|
// Splitting exp through party members
|
||||||
AbstractParty party;
|
AbstractParty party;
|
||||||
if (splitExp && (party = getParty()) != null) {
|
if (splitExp && (party = getParty()) != null && MMOCore.plugin.configManager.splitMainExp) {
|
||||||
final List<PlayerData> nearbyMembers = party.getOnlineMembers().stream()
|
final List<PlayerData> nearbyMembers = party.getOnlineMembers().stream()
|
||||||
.filter(pd -> {
|
.filter(pd -> {
|
||||||
if (equals(pd) || pd.hasReachedMaxLevel())
|
if (equals(pd) || pd.hasReachedMaxLevel() || Math.abs(pd.getLevel() - getLevel()) > MMOCore.plugin.configManager.maxPartyLevelDifference)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
final double maxDis = MMOCore.plugin.configManager.partyMaxExpSplitRange;
|
final double maxDis = MMOCore.plugin.configManager.partyMaxExpSplitRange;
|
||||||
|
@ -27,7 +27,7 @@ import java.util.logging.Level;
|
|||||||
public class ConfigManager {
|
public class ConfigManager {
|
||||||
public final CommandVerbose commandVerbose = new CommandVerbose();
|
public final CommandVerbose commandVerbose = new CommandVerbose();
|
||||||
|
|
||||||
public boolean overrideVanillaExp, canCreativeCast, passiveSkillNeedBound, cobbleGeneratorXP, saveDefaultClassInfo, attributesAsClassInfo, splitProfessionExp, disableQuestBossBar, pvpModeEnabled;
|
public boolean overrideVanillaExp, canCreativeCast, passiveSkillNeedBound, cobbleGeneratorXP, saveDefaultClassInfo, attributesAsClassInfo, splitProfessionExp, splitMainExp, disableQuestBossBar, pvpModeEnabled;
|
||||||
public String partyChatPrefix, noSkillBoundPlaceholder;
|
public String partyChatPrefix, noSkillBoundPlaceholder;
|
||||||
public ChatColor staminaFull, staminaHalf, staminaEmpty;
|
public ChatColor staminaFull, staminaHalf, staminaEmpty;
|
||||||
public long combatLogTimer, lootChestExpireTime, lootChestPlayerCooldown, globalSkillCooldown;
|
public long combatLogTimer, lootChestExpireTime, lootChestPlayerCooldown, globalSkillCooldown;
|
||||||
@ -129,6 +129,7 @@ public class ConfigManager {
|
|||||||
maxPartyLevelDifference = MMOCore.plugin.getConfig().getInt("party.max-level-difference");
|
maxPartyLevelDifference = MMOCore.plugin.getConfig().getInt("party.max-level-difference");
|
||||||
partyMaxExpSplitRange = MMOCore.plugin.getConfig().getDouble("party.max-exp-split-range");
|
partyMaxExpSplitRange = MMOCore.plugin.getConfig().getDouble("party.max-exp-split-range");
|
||||||
splitProfessionExp = MMOCore.plugin.getConfig().getBoolean("party.profession-exp-split");
|
splitProfessionExp = MMOCore.plugin.getConfig().getBoolean("party.profession-exp-split");
|
||||||
|
splitMainExp = MMOCore.plugin.getConfig().getBoolean("party.main-exp-split");
|
||||||
disableQuestBossBar = MMOCore.plugin.getConfig().getBoolean("mmocore-quests.disable-boss-bar");
|
disableQuestBossBar = MMOCore.plugin.getConfig().getBoolean("mmocore-quests.disable-boss-bar");
|
||||||
|
|
||||||
// Combat
|
// Combat
|
||||||
|
@ -153,7 +153,10 @@ party:
|
|||||||
# Set to 0 to disable
|
# Set to 0 to disable
|
||||||
max-exp-split-range: 48
|
max-exp-split-range: 48
|
||||||
|
|
||||||
# When enabled, being in a party also splits profession exp
|
# When enabled, being in a party splits class exp
|
||||||
|
main-exp-split: true
|
||||||
|
|
||||||
|
# When enabled, being in a party splits profession exp
|
||||||
profession-exp-split: false
|
profession-exp-split: false
|
||||||
|
|
||||||
# Not relevant when not using MMOCore as quest plugin
|
# Not relevant when not using MMOCore as quest plugin
|
||||||
|
Loading…
Reference in New Issue
Block a user