diff --git a/patches/api/Missing-Entity-API.patch b/patches/api/Missing-Entity-API.patch index f0a8f648af..31f40c2071 100644 --- a/patches/api/Missing-Entity-API.patch +++ b/patches/api/Missing-Entity-API.patch @@ -12,6 +12,7 @@ Co-authored-by: Amin Co-authored-by: TrollyLoki Co-authored-by: FireInstall Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> +Co-authored-by: TotalledZebra diff --git a/src/main/java/io/papermc/paper/entity/SchoolableFish.java b/src/main/java/io/papermc/paper/entity/SchoolableFish.java new file mode 100644 @@ -348,6 +349,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ -public interface Cod extends Fish { } +public interface Cod extends io.papermc.paper.entity.SchoolableFish { } // Paper - Schooling Fish API +diff --git a/src/main/java/org/bukkit/entity/Damageable.java b/src/main/java/org/bukkit/entity/Damageable.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Damageable.java ++++ b/src/main/java/org/bukkit/entity/Damageable.java +@@ -0,0 +0,0 @@ public interface Damageable extends Entity { + */ + void setHealth(double health); + ++ // Paper start - entity heal API ++ /** ++ * Heal this entity by the given amount. This will call {@link org.bukkit.event.entity.EntityRegainHealthEvent}. ++ * ++ * @param amount heal amount ++ */ ++ default void heal(final double amount) { ++ this.heal(amount, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.CUSTOM); ++ } ++ ++ /** ++ * Heal this entity by the given amount. This will call {@link org.bukkit.event.entity.EntityRegainHealthEvent}. ++ * ++ * @param amount heal amount ++ * @param reason heal reason ++ */ ++ void heal(double amount, @NotNull org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason reason); ++ // Paper end - entity heal API ++ + /** + * Gets the entity's absorption amount. + * diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java diff --git a/patches/server/Missing-Entity-API.patch b/patches/server/Missing-Entity-API.patch index d356a4c0b4..c2053e97db 100644 --- a/patches/server/Missing-Entity-API.patch +++ b/patches/server/Missing-Entity-API.patch @@ -42,6 +42,7 @@ Co-authored-by: Amin Co-authored-by: TrollyLoki Co-authored-by: FireInstall Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> +Co-authored-by: TotalledZebra diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -632,6 +633,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - Missing Dolphin API } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragonPart.java +@@ -0,0 +0,0 @@ public class CraftEnderDragonPart extends CraftComplexPart implements EnderDrago + this.getParent().setHealth(health); + } + ++ // Paper start - entity heal API ++ @Override ++ public void heal(final double amount, final org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason reason) { ++ this.getParent().heal(amount, reason); ++ } ++ // Paper end - entity heal API ++ + @Override + public double getAbsorptionAmount() { + return this.getParent().getAbsorptionAmount(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -832,6 +851,20 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + } + } + ++ // Paper start - entity heal API ++ @Override ++ public void heal(final double amount, final org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason reason) { ++ this.getHandle().heal((float) amount, reason); ++ } ++ // Paper end - entity heal API ++ + @Override + public double getAbsorptionAmount() { + return this.getHandle().getAbsorptionAmount(); @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override