Make Panda implement Sittable (#7414)

This commit is contained in:
Jake Potrebic 2022-02-12 05:36:41 -08:00 committed by GitHub
parent 4a745f9163
commit 2c8d48c555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 5 deletions

View File

@ -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
}

View File

@ -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