mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-03-28 20:59:44 +01:00
76 lines
1.8 KiB
Java
76 lines
1.8 KiB
Java
package com.gmail.nossr50.events.party;
|
|
|
|
import com.gmail.nossr50.datatypes.party.Party;
|
|
import org.bukkit.event.Cancellable;
|
|
import org.bukkit.event.Event;
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
|
private final Party party;
|
|
private float xpGained;
|
|
private boolean cancelled;
|
|
|
|
public McMMOPartyXpGainEvent(Party party, float xpGained) {
|
|
this.party = party;
|
|
this.xpGained = xpGained;
|
|
this.cancelled = false;
|
|
}
|
|
|
|
public Party getParty() {
|
|
return party;
|
|
}
|
|
|
|
/**
|
|
* @return The amount of experience gained in this event
|
|
*/
|
|
public float getRawXpGained() {
|
|
return xpGained;
|
|
}
|
|
|
|
/**
|
|
* @return int amount of experience gained in this event
|
|
*/
|
|
@Deprecated
|
|
public int getXpGained() {
|
|
return (int) xpGained;
|
|
}
|
|
|
|
/**
|
|
* @param xpGained set amount of experience gained in this event
|
|
*/
|
|
public void setRawXpGained(float xpGained) {
|
|
this.xpGained = xpGained;
|
|
}
|
|
|
|
/**
|
|
* @param xpGained set int amount of experience gained in this event
|
|
*/
|
|
@Deprecated
|
|
public void setXpGained(int xpGained) {
|
|
this.xpGained = xpGained;
|
|
}
|
|
|
|
/** Following are required for Cancellable **/
|
|
@Override
|
|
public boolean isCancelled() {
|
|
return cancelled;
|
|
}
|
|
|
|
@Override
|
|
public void setCancelled(boolean cancelled) {
|
|
this.cancelled = cancelled;
|
|
}
|
|
|
|
/** Rest of file is required boilerplate for custom events **/
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
@Override
|
|
public HandlerList getHandlers() {
|
|
return handlers;
|
|
}
|
|
|
|
public static HandlerList getHandlerList() {
|
|
return handlers;
|
|
}
|
|
}
|