mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Changed experience storage from integers to floats
This will make sure no experience is lost when the server has high skill modifiers configured, or when low amounts of experience are being shared.
This commit is contained in:
@ -8,9 +8,9 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
* Called when a player gains XP in a skill
|
||||
*/
|
||||
public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent {
|
||||
private int xpGained;
|
||||
private float xpGained;
|
||||
|
||||
public McMMOPlayerXpGainEvent(Player player, SkillType skill, int xpGained) {
|
||||
public McMMOPlayerXpGainEvent(Player player, SkillType skill, float xpGained) {
|
||||
super(player, skill);
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
@ -18,13 +18,29 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent {
|
||||
/**
|
||||
* @return The amount of experience gained in this event
|
||||
*/
|
||||
public int getXpGained() {
|
||||
public float getRawXpGained() {
|
||||
return xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xpGained int amount of experience gained in this event
|
||||
*/
|
||||
@Deprecated
|
||||
public int getXpGained() {
|
||||
return (int) xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xpGained int amount of experience gained in this event
|
||||
*/
|
||||
public void setRawXpGained(float xpGained) {
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xpGained int amount of experience gained in this event
|
||||
*/
|
||||
@Deprecated
|
||||
public void setXpGained(int xpGained) {
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
Reference in New Issue
Block a user