mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Added party levels
Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
This commit is contained in:
@ -0,0 +1,54 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
|
||||
public class McMMOPartyLevelUpEvent extends Event implements Cancellable {
|
||||
private Party party;
|
||||
private int levelsChanged;
|
||||
private boolean cancelled;
|
||||
|
||||
public McMMOPartyLevelUpEvent(Party party, int levelsChanged) {
|
||||
this.party = party;
|
||||
this.levelsChanged = levelsChanged;
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public Party getParty() {
|
||||
return party;
|
||||
}
|
||||
|
||||
public int getLevelsChanged() {
|
||||
return levelsChanged;
|
||||
}
|
||||
|
||||
public void setLevelsChanged(int levelsChanged) {
|
||||
this.levelsChanged = levelsChanged;
|
||||
}
|
||||
|
||||
/** 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;
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
|
||||
public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
private 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user