Allow global multiplier to be a double

This commit is contained in:
Bill Tarbell 2012-08-01 19:32:25 -04:00
parent 394ddd4e51
commit d528f11082
3 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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); }

View File

@ -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) {