mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 14:16:45 +01:00
17a0382283
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.
48 lines
1.1 KiB
Java
48 lines
1.1 KiB
Java
package com.gmail.nossr50.events.experience;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
|
|
|
/**
|
|
* Called when a player gains XP in a skill
|
|
*/
|
|
public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent {
|
|
private float xpGained;
|
|
|
|
public McMMOPlayerXpGainEvent(Player player, SkillType skill, float xpGained) {
|
|
super(player, skill);
|
|
this.xpGained = xpGained;
|
|
}
|
|
|
|
/**
|
|
* @return The amount of experience gained in this event
|
|
*/
|
|
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;
|
|
}
|
|
}
|