From 2c8d48c5557ebca6886b5a3e17488349f5e7164b Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sat, 12 Feb 2022 05:36:41 -0800 Subject: [PATCH] Make Panda implement Sittable (#7414) --- .../0312-Missing-Entity-Behavior-API.patch | 28 +++++++++++++++++-- .../0682-Missing-Entity-Behavior-API.patch | 4 +-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/patches/api/0312-Missing-Entity-Behavior-API.patch b/patches/api/0312-Missing-Entity-Behavior-API.patch index e0ed9f4cea..39b23e64b9 100644 --- a/patches/api/0312-Missing-Entity-Behavior-API.patch +++ b/patches/api/0312-Missing-Entity-Behavior-API.patch @@ -176,10 +176,19 @@ index 498e182846b81d50b3a594254e8b341fb23e8763..3826363a1954afcddaadec7f96ac1830 + // Paper end - Add more fox behavior API } diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java -index a6a7429ed2e1eefb2b12b7480ed74fcc3963a864..9d065625be5931d970d7f34e1225fae1af960314 100644 +index a6a7429ed2e1eefb2b12b7480ed74fcc3963a864..1dcc2c8f4899da029af8b1c1b2ff1b5e368e82c1 100644 --- a/src/main/java/org/bukkit/entity/Panda.java +++ b/src/main/java/org/bukkit/entity/Panda.java -@@ -63,4 +63,112 @@ public interface Panda extends Animals { +@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; + /** + * Panda entity. + */ +-public interface Panda extends Animals { ++public interface Panda extends Animals, Sittable { // Paper + + /** + * Gets this Panda's main gene. +@@ -63,4 +63,125 @@ public interface Panda extends Animals { return recessive; } } @@ -281,14 +290,27 @@ index a6a7429ed2e1eefb2b12b7480ed74fcc3963a864..9d065625be5931d970d7f34e1225fae1 + * Sets if this panda is currently sitting. + * + * @param sitting is currently sitting ++ * @deprecated use {@link #setSitting(boolean)} + */ -+ void setIsSitting(boolean sitting); ++ @Deprecated(forRemoval = true) ++ default void setIsSitting(boolean sitting) { ++ this.setSitting(sitting); ++ } ++ ++ /** ++ * Sets if this panda is currently sitting. ++ * ++ * @param sitting is currently sitting ++ */ ++ @Override ++ void setSitting(boolean sitting); + + /** + * Gets if this panda is sitting. + * + * @return is sitting + */ ++ @Override + boolean isSitting(); + // Paper end - Panda API } diff --git a/patches/server/0682-Missing-Entity-Behavior-API.patch b/patches/server/0682-Missing-Entity-Behavior-API.patch index da5322e4d3..ac5c9fdaa1 100644 --- a/patches/server/0682-Missing-Entity-Behavior-API.patch +++ b/patches/server/0682-Missing-Entity-Behavior-API.patch @@ -157,7 +157,7 @@ index b647a5b9fdc1da61c4035d6f2cef7814033dc608..9795341efa748c2d94567e882cd5f26a + // Paper end - Add more fox behavior API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java -index 2d2620dbb16aec850e8afda02174508a4be5a313..ec56a520da22248cdcdfaa179489aa0db0f2273f 100644 +index 2d2620dbb16aec850e8afda02174508a4be5a313..ba4e6deaaa725296be830324d2c6486844a4e886 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java @@ -46,6 +46,77 @@ public class CraftPanda extends CraftAnimals implements Panda { @@ -231,7 +231,7 @@ index 2d2620dbb16aec850e8afda02174508a4be5a313..ec56a520da22248cdcdfaa179489aa0d + } + + @Override -+ public void setIsSitting(boolean sitting) { ++ public void setSitting(boolean sitting) { + this.getHandle().sit(sitting); + } + // Paper end - Panda API