mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
57dd397155
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b999860d SPIGOT-2304: Add LootGenerateEvent CraftBukkit Changes:77fd87e4
SPIGOT-2304: Implement LootGenerateEventa1a705ee
SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent41712edd
SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
From 08eb4769f3ce11fe64a2d8863825a28bd9f815cb Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 8feb6698f..d51d2ec1d 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
|
|
--
|
|
2.26.2
|
|
|