2018-07-23 08:39:55 +00:00
|
|
|
From 8121678797e7b682fc53643ab34992d1aeacba8d Mon Sep 17 00:00:00 2001
|
2016-04-22 06:48:49 +00:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.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
|
2017-07-03 15:38:49 +00:00
|
|
|
index 1dd50c56..74fc12e9 100644
|
2016-04-22 06:48:49 +00:00
|
|
|
--- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
2016-11-17 02:23:38 +00:00
|
|
|
@@ -13,12 +13,31 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
2016-04-22 06:48:49 +00:00
|
|
|
private boolean cancelled;
|
|
|
|
private double amount;
|
|
|
|
private final RegainReason regainReason;
|
|
|
|
+ private final boolean isFastRegen; // Paper
|
|
|
|
|
|
|
|
public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) {
|
|
|
|
+ // Paper start - Forward
|
|
|
|
+ this(entity, amount, regainReason, false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public EntityRegainHealthEvent(final Entity entity, final double amount, 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
|
|
|
|
--
|
2018-07-19 04:42:43 +00:00
|
|
|
2.18.0
|
2016-04-22 06:48:49 +00:00
|
|
|
|