From aed4433aca85821729d89a18227bb685e308f567 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Tue, 22 Jun 2021 03:44:02 -0400 Subject: [PATCH] Add more fox API (#5743) --- build-data/paper.at | 8 ++ .../0320-Missing-Entity-Behavior-API.patch | 73 +++++++++++++++++++ .../0718-Missing-Entity-Behavior-API.patch | 56 ++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 patches/api/0320-Missing-Entity-Behavior-API.patch create mode 100644 patches/server/0718-Missing-Entity-Behavior-API.patch diff --git a/build-data/paper.at b/build-data/paper.at index 16a94f7cf6..e3c2910ea1 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -215,3 +215,11 @@ public net.minecraft.world.entity.monster.Witch usingTime # PlayerDeathEvent#getItemsToKeep public net.minecraft.world.entity.player.Inventory compartments + +# Missing Entity 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/0320-Missing-Entity-Behavior-API.patch b/patches/api/0320-Missing-Entity-Behavior-API.patch new file mode 100644 index 0000000000..8a426bcb12 --- /dev/null +++ b/patches/api/0320-Missing-Entity-Behavior-API.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Fri, 28 May 2021 21:06:59 -0400 +Subject: [PATCH] Missing Entity Behavior API + + +diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java +index 498e182846b81d50b3a594254e8b341fb23e8763..3826363a1954afcddaadec7f96ac18300f8e89e9 100644 +--- a/src/main/java/org/bukkit/entity/Fox.java ++++ b/src/main/java/org/bukkit/entity/Fox.java +@@ -85,4 +85,62 @@ public interface Fox extends Animals, Sittable { + RED, + SNOW; + } ++ ++ // Paper start - Add more fox behavior API ++ /** ++ * Sets if the fox is interested. ++ * ++ * @param interested is interested ++ */ ++ public void setInterested(boolean interested); ++ ++ /** ++ * Gets if the fox is interested. ++ * ++ * @return fox is interested ++ */ ++ public boolean isInterested(); ++ ++ /** ++ * Sets if the fox is leaping. ++ * ++ * @param leaping is leaping ++ */ ++ public void setLeaping(boolean leaping); ++ ++ /** ++ * Gets if the fox is leaping. ++ * ++ * @return fox is leaping ++ */ ++ public boolean isLeaping(); ++ ++ /** ++ * Sets if the fox is defending. ++ * ++ * @param defending is defending ++ */ ++ public void setDefending(boolean defending); ++ ++ /** ++ * Gets if the fox is defending. ++ * ++ * @return fox is defending ++ */ ++ public boolean isDefending(); ++ ++ /** ++ * Sets if the fox face planted. ++ * ++ * @param faceplanted face planted ++ */ ++ public void setFaceplanted(boolean faceplanted); ++ ++ /** ++ * Gets if the fox face planted. ++ * ++ * @return fox face planted ++ */ ++ public boolean isFaceplanted(); ++ // Paper end - Add more fox behavior API + } diff --git a/patches/server/0718-Missing-Entity-Behavior-API.patch b/patches/server/0718-Missing-Entity-Behavior-API.patch new file mode 100644 index 0000000000..f0819edcdc --- /dev/null +++ b/patches/server/0718-Missing-Entity-Behavior-API.patch @@ -0,0 +1,56 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Mon, 21 Jun 2021 23:56:07 -0400 +Subject: [PATCH] Missing Entity Behavior API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +index b647a5b9fdc1da61c4035d6f2cef7814033dc608..887512ec0945d71be9ab46424d92074e24cb71fb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +@@ -114,4 +114,45 @@ public class CraftFox extends CraftAnimals implements Fox { + + this.getHandle().getEntityData().set(net.minecraft.world.entity.animal.Fox.DATA_TRUSTED_ID_1, player == null ? Optional.empty() : Optional.of(player.getUniqueId())); + } ++ // Paper start - Add more fox behavior API ++ @Override ++ public void setInterested(boolean interested) { ++ getHandle().setIsInterested(interested); ++ } ++ ++ @Override ++ public boolean isInterested() { ++ return getHandle().isInterested(); ++ } ++ ++ @Override ++ public void setLeaping(boolean leaping) { ++ getHandle().setIsPouncing(leaping); ++ } ++ ++ @Override ++ public boolean isLeaping() { ++ return getHandle().isPouncing(); ++ } ++ ++ @Override ++ public void setDefending(boolean defending) { ++ getHandle().setDefending(defending); ++ } ++ ++ @Override ++ public boolean isDefending() { ++ return getHandle().isDefending(); ++ } ++ ++ @Override ++ public void setFaceplanted(boolean faceplanted) { ++ getHandle().setFaceplanted(faceplanted); ++ } ++ ++ @Override ++ public boolean isFaceplanted() { ++ return getHandle().isFaceplanted(); ++ } ++ // Paper end - Add more fox behavior API + }