From 5b6c6fee51a4a524083cf54c809e63f58bbdca00 Mon Sep 17 00:00:00 2001 From: Kounan Date: Wed, 18 Nov 2015 23:09:08 -0800 Subject: [PATCH 1/3] Fix issue #2669 --- src/main/java/com/gmail/nossr50/party/ShareHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/party/ShareHandler.java b/src/main/java/com/gmail/nossr50/party/ShareHandler.java index 95cb97062..fd2389e03 100644 --- a/src/main/java/com/gmail/nossr50/party/ShareHandler.java +++ b/src/main/java/com/gmail/nossr50/party/ShareHandler.java @@ -44,7 +44,7 @@ public final class ShareHandler { nearMembers.add(mcMMOPlayer.getPlayer()); int partySize = nearMembers.size(); - double shareBonus = Math.min(Config.getInstance().getPartyShareBonusBase() + (partySize * Config.getInstance().getPartyShareBonusIncrease()), Config.getInstance().getPartyShareBonusCap()); + double shareBonus = Math.min(Config.getInstance().getPartyShareBonusBase() * Math.pow(Config.getInstance().getPartyShareBonusIncrease(), partySize), Config.getInstance().getPartyShareBonusCap()); float splitXp = (float) (xp / partySize * shareBonus); for (Player member : nearMembers) { From 6e2d59e0ab8c3e094a182dfd1abe715ee96e9273 Mon Sep 17 00:00:00 2001 From: bibekaur Date: Sun, 29 Nov 2015 23:49:30 -0800 Subject: [PATCH 2/3] Fix to Customize Skills to use Linear vs Exponential Curve Setting --- .../config/experience/ExperienceConfig.java | 3 ++- .../nossr50/datatypes/player/PlayerProfile.java | 2 +- src/main/resources/experience.yml | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 0062d7b7f..72d00dd11 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -165,7 +165,8 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { */ /* Curve settings */ - public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); } + public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve.DEFAULT")); } + public FormulaType getFormulaType(SkillType skill) { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve." + StringUtils.getCapitalized(skill.toString()))); } public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience_Formula.Cumulative_Curve", false); } /* Curve values */ diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index b55cfd98b..f2ed6fd2f 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -345,7 +345,7 @@ public class PlayerProfile { */ public int getXpToLevel(SkillType skillType) { int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(skillType); - FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType(); + FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType(skillType); return mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType); } diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 5d53711e0..53e7629cf 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -14,7 +14,21 @@ Experience_Formula: # If an invalid value is entered, this will reset to the default setting, which is LINEAR # LINEAR: base + (level * multiplier) # EXPONENTIAL: multiplier * level ^ exponent + base - Curve: LINEAR + Curve: + Swords: LINEAR + Taming: EXPONENTIAL + Acrobatics: LINEAR + Excavation: EXPONENTIAL + Herbalism: LINEAR + Unarmed: EXPONENTIAL + Woodcutting: LINEAR + Mining: EXPONENTIAL + Archery: LINEAR + Axes: EXPONENTIAL + Repair: LINEAR + Fishing: EXPONENTIAL + Alchemy: LINEAR + DEFAULT: LINEAR # If invalid values are entered mcMMO will not start and print an error in the console Linear_Values: From dc4ac2ebd1a96d99c959ff5ebd1c2cc884fdbfc8 Mon Sep 17 00:00:00 2001 From: bibekaur Date: Wed, 2 Dec 2015 19:26:35 -0800 Subject: [PATCH 3/3] Revert "Fix to Customize Skills to use Linear vs Exponential Curve Setting" This reverts commit 6e2d59e0ab8c3e094a182dfd1abe715ee96e9273. --- .../config/experience/ExperienceConfig.java | 3 +-- .../nossr50/datatypes/player/PlayerProfile.java | 2 +- src/main/resources/experience.yml | 16 +--------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 72d00dd11..0062d7b7f 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -165,8 +165,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { */ /* Curve settings */ - public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve.DEFAULT")); } - public FormulaType getFormulaType(SkillType skill) { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve." + StringUtils.getCapitalized(skill.toString()))); } + public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); } public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience_Formula.Cumulative_Curve", false); } /* Curve values */ diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index f2ed6fd2f..b55cfd98b 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -345,7 +345,7 @@ public class PlayerProfile { */ public int getXpToLevel(SkillType skillType) { int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(skillType); - FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType(skillType); + FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType(); return mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType); } diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 53e7629cf..5d53711e0 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -14,21 +14,7 @@ Experience_Formula: # If an invalid value is entered, this will reset to the default setting, which is LINEAR # LINEAR: base + (level * multiplier) # EXPONENTIAL: multiplier * level ^ exponent + base - Curve: - Swords: LINEAR - Taming: EXPONENTIAL - Acrobatics: LINEAR - Excavation: EXPONENTIAL - Herbalism: LINEAR - Unarmed: EXPONENTIAL - Woodcutting: LINEAR - Mining: EXPONENTIAL - Archery: LINEAR - Axes: EXPONENTIAL - Repair: LINEAR - Fishing: EXPONENTIAL - Alchemy: LINEAR - DEFAULT: LINEAR + Curve: LINEAR # If invalid values are entered mcMMO will not start and print an error in the console Linear_Values: