mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
EntityRegainHealthEvent isFastRegen API
This commit is contained in:
parent
bcd6aecdab
commit
391451207f
1 changed files with 19 additions and 0 deletions
|
@ -13,13 +13,32 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private double amount;
|
private double amount;
|
||||||
private final RegainReason regainReason;
|
private final RegainReason regainReason;
|
||||||
|
private final boolean isFastRegen; // Paper
|
||||||
|
|
||||||
public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason) {
|
public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason) {
|
||||||
|
// Paper start - Forward
|
||||||
|
this(entity, amount, regainReason, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason, boolean isFastRegen) {
|
||||||
|
// Paper end
|
||||||
super(entity);
|
super(entity);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.regainReason = regainReason;
|
this.regainReason = regainReason;
|
||||||
|
this.isFastRegen = isFastRegen; // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - Add getter for isFastRegen
|
||||||
|
/**
|
||||||
|
* Is this event a result of the fast regeneration mechanic
|
||||||
|
*
|
||||||
|
* @return Whether the event is the result of a fast regeneration mechanic
|
||||||
|
*/
|
||||||
|
public boolean isFastRegen() {
|
||||||
|
return isFastRegen;
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the amount of regained health
|
* Gets the amount of regained health
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue