Better events! Will be making them even better tmr (:

This commit is contained in:
DroppingAnvil
2019-11-01 04:52:42 -05:00
parent bbed3f0bb0
commit 5556458c93
4 changed files with 30 additions and 1 deletions

View File

@@ -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;

View File

@@ -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;