mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-30 20:48:19 +01:00
Allow global multiplier to be a double
This commit is contained in:
parent
394ddd4e51
commit
d528f11082
@ -13,7 +13,7 @@ import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public class XprateCommand implements CommandExecutor {
|
||||
private final mcMMO plugin;
|
||||
private static int oldRate = Config.getInstance().xpGainMultiplier;
|
||||
private static double oldRate = Config.getInstance().xpGainMultiplier;
|
||||
private static boolean xpEvent = false;
|
||||
|
||||
public XprateCommand (mcMMO plugin) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
public class Config extends ConfigLoader {
|
||||
private static Config instance;
|
||||
public int xpGainMultiplier = 1;
|
||||
public double xpGainMultiplier = 1;
|
||||
|
||||
private Config() {
|
||||
super("config.yml");
|
||||
@ -343,7 +343,7 @@ public class Config extends ConfigLoader {
|
||||
/* General Settings */
|
||||
public boolean getExperienceGainsMobspawnersEnabled() { return config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); }
|
||||
public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); }
|
||||
public int getExperienceGainsGlobalMultiplier() { return config.getInt("Experience.Gains.Multiplier.Global", 1); }
|
||||
public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience.Gains.Multiplier.Global", 1.0); }
|
||||
|
||||
/* Combat XP Multipliers */
|
||||
public double getPlayerVersusPlayerXP() { return config.getDouble("Experience.Gains.Multiplier.PVP", 1.0); }
|
||||
|
@ -108,7 +108,7 @@ public class McMMOPlayer {
|
||||
* @param newValue The amount of XP to add
|
||||
*/
|
||||
public void addXPOverrideBonus(SkillType skillType, int xp) {
|
||||
int modifiedXp = xp * Config.getInstance().xpGainMultiplier;
|
||||
int modifiedXp = (int)Math.floor(xp * Config.getInstance().xpGainMultiplier);
|
||||
addXPOverride(skillType, modifiedXp);
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class McMMOPlayer {
|
||||
bonusModifier = calculatePartyXPModifier(skillType);
|
||||
}
|
||||
|
||||
int xp = (int) (newValue / skillType.getXpModifier()) * Config.getInstance().xpGainMultiplier;
|
||||
int xp = (int)Math.floor((newValue / skillType.getXpModifier()) * Config.getInstance().xpGainMultiplier);
|
||||
|
||||
if (bonusModifier > 0) {
|
||||
if (bonusModifier >= 2) {
|
||||
|
Loading…
Reference in New Issue
Block a user