PowerRegenEvent and optimization
- Add power regeneration event - Change getNone(), a deprecated method, to getWilderness() - Optimization
This commit is contained in:
@@ -8,7 +8,7 @@ import com.massivecraft.factions.Faction;
|
||||
*/
|
||||
public class FactionPlayerEvent extends FactionEvent {
|
||||
|
||||
private final FPlayer fPlayer;
|
||||
protected final FPlayer fPlayer;
|
||||
|
||||
public FactionPlayerEvent(Faction faction, FPlayer fPlayer) {
|
||||
super(faction);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
|
||||
/**
|
||||
* Event called when a player regenerate power.
|
||||
*/
|
||||
public class PowerRegenEvent extends FactionPlayerEvent implements Cancellable {
|
||||
|
||||
private boolean cancelled = false;
|
||||
|
||||
public PowerRegenEvent(Faction f, FPlayer p) {
|
||||
super(f, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean c) {
|
||||
this.cancelled = c;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user