2016-04-22 08:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
|
|
|
Date: Fri, 22 Apr 2016 01:43:11 -0500
|
|
|
|
Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2016-04-22 08:48:49 +02:00
|
|
|
--- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
|
|
|
@@ -0,0 +0,0 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
|
|
|
private boolean cancelled;
|
|
|
|
private double amount;
|
|
|
|
private final RegainReason regainReason;
|
|
|
|
+ private final boolean isFastRegen; // Paper
|
|
|
|
|
2019-03-20 01:28:15 +01:00
|
|
|
public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason) {
|
2016-04-22 08:48:49 +02:00
|
|
|
+ // Paper start - Forward
|
|
|
|
+ this(entity, amount, regainReason, false);
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason, boolean isFastRegen) {
|
2016-04-22 08:48:49 +02:00
|
|
|
+ // Paper end
|
|
|
|
super(entity);
|
|
|
|
this.amount = amount;
|
|
|
|
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
|