aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0038-EntityRegainHealthEvent-isFastRegen-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0038-EntityRegainHealthEvent-isFastRegen-API.patch')
-rw-r--r--patches/api/0038-EntityRegainHealthEvent-isFastRegen-API.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/api/0038-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/api/0038-EntityRegainHealthEvent-isFastRegen-API.patch
new file mode 100644
index 0000000000..f06ee13d15
--- /dev/null
+++ b/patches/api/0038-EntityRegainHealthEvent-isFastRegen-API.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+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
+index 8feb6698f9630f099be99e52d1149cd6bc615197..d51d2ec1d04d9ea8a25a70d0d856f2355ebfcb4a 100644
+--- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
++++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
+@@ -13,12 +13,31 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
+ private boolean cancelled;
+ private double amount;
+ private final RegainReason regainReason;
++ private final boolean isFastRegen; // Paper
+
+ 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);
+ 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