diff --git a/build-data/paper.at b/build-data/paper.at index dd2b3c66b3..a5d4276693 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -210,10 +210,9 @@ public net.minecraft.world.entity.monster.Witch usingTime # PlayerDeathEvent#getItemsToKeep public net.minecraft.world.entity.player.Inventory compartments -# Missing Entity API +# Missing Entity Behavior API public net.minecraft.world.entity.animal.Fox isDefending()Z public net.minecraft.world.entity.animal.Fox setDefending(Z)V - public net.minecraft.world.entity.animal.Fox isFaceplanted()Z public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V diff --git a/patches/api/Missing-Entity-Behavior-API.patch b/patches/api/Missing-Entity-Behavior-API.patch index 5fddc5a927..e03e5feca3 100644 --- a/patches/api/Missing-Entity-Behavior-API.patch +++ b/patches/api/Missing-Entity-Behavior-API.patch @@ -4,6 +4,65 @@ Date: Fri, 28 May 2021 21:06:59 -0400 Subject: [PATCH] Missing Entity Behavior API +diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/AbstractHorse.java ++++ b/src/main/java/org/bukkit/entity/AbstractHorse.java +@@ -0,0 +0,0 @@ public interface AbstractHorse extends Vehicle, InventoryHolder, Tameable { + @NotNull + @Override + public AbstractHorseInventory getInventory(); ++ ++ // Paper start - Horse API ++ /** ++ * Gets if a horse is in their eating grass animation. ++ * ++ * @return eating grass animation is active ++ */ ++ public boolean isEatingGrass(); ++ ++ /** ++ * Sets if a horse is in their eating grass animation. ++ * ++ *

When true, the horse will lower its neck.

++ * ++ * @param eating eating grass animation is active ++ */ ++ public void setEatingGrass(boolean eating); ++ ++ /** ++ * Gets if a horse is in their rearing animation. ++ * ++ * @return rearing animation is active ++ */ ++ public boolean isRearing(); ++ ++ /** ++ * Sets if a horse is in their rearing animation. ++ * ++ *

When true, the horse will stand on its hind legs.

++ * ++ * @param rearing rearing animation is active ++ */ ++ public void setRearing(boolean rearing); ++ ++ /** ++ * Gets if a horse is in their eating animation. ++ * ++ * @return eating animation is active ++ */ ++ public boolean isEating(); ++ ++ /** ++ * Sets if a horse is in their eating animation. ++ * ++ *

When true, the horse will bob its head.

++ * ++ * @param eating eating animation is active ++ */ ++ public void setEating(boolean eating); ++ // Paper end - Horse API + } diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Cat.java diff --git a/patches/server/Missing-Entity-Behavior-API.patch b/patches/server/Missing-Entity-Behavior-API.patch index 2a7e46be31..a263e14473 100644 --- a/patches/server/Missing-Entity-Behavior-API.patch +++ b/patches/server/Missing-Entity-Behavior-API.patch @@ -4,6 +4,78 @@ Date: Mon, 21 Jun 2021 23:56:07 -0400 Subject: [PATCH] Missing Entity Behavior API +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +@@ -0,0 +0,0 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, + + } + ++ // Paper Start - Horse API ++ public void setMouthOpen(boolean open) { ++ this.setFlag(FLAG_OPEN_MOUTH, open); ++ } ++ public boolean isMouthOpen() { ++ return this.getFlag(FLAG_OPEN_MOUTH); ++ } ++ // Paper End - Horse API + private void openMouth() { + if (!this.level.isClientSide) { + this.mouthCounter = 1; +@@ -0,0 +0,0 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, + this.setFlag(16, eatingGrass); + } + ++ // Paper Start - Horse API ++ public void setForceStanding(boolean standing) { ++ this.setFlag(FLAG_STANDING, standing); ++ } ++ // Paper End - Horse API + public void setStanding(boolean angry) { + if (angry) { + this.setEating(false); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +@@ -0,0 +0,0 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac + public AbstractHorseInventory getInventory() { + return new CraftSaddledInventory(getHandle().inventory); + } ++ ++ // Paper start - Horse API ++ @Override ++ public boolean isEatingGrass() { ++ return this.getHandle().isEating(); ++ } ++ ++ @Override ++ public void setEatingGrass(boolean eating) { ++ this.getHandle().setEating(eating); ++ } ++ ++ @Override ++ public boolean isRearing() { ++ return this.getHandle().isStanding(); ++ } ++ ++ @Override ++ public void setRearing(boolean rearing) { ++ this.getHandle().setForceStanding(rearing); ++ } ++ ++ @Override ++ public boolean isEating() { ++ return this.getHandle().isMouthOpen(); ++ } ++ ++ @Override ++ public void setEating(boolean eating) { ++ this.getHandle().setMouthOpen(eating); ++ } ++ // Paper end - Horse API + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java