Better events! Will be making them even better tmr (:
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -68,6 +69,12 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the damage to a players individual power
|
||||
* @return power lost as a Double.
|
||||
*/
|
||||
public Double getPowerLost() {return Conf.powerPerDeath;}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
|
||||
import com.massivecraft.factions.zcore.persist.MemoryFPlayers;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
@@ -15,6 +18,14 @@ public class PowerRegenEvent extends FactionPlayerEvent implements Cancellable {
|
||||
super(f, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of power this player will regen
|
||||
* @return power amount gained as a Double.
|
||||
*/
|
||||
public Double getPowerGained() {
|
||||
return fPlayer.getMillisPassed() * Conf.powerPerMinute / 60000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
|
||||
Reference in New Issue
Block a user