13
0
geforkt von Mirrors/Paper

Add Missing Entity API: Cat (#5744)

Dieser Commit ist enthalten in:
Owen1212055 2021-08-27 14:16:41 -04:00
Ursprung cc4e273b07
Commit 0f34801f3d
2 geänderte Dateien mit 79 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -4,6 +4,47 @@ Date: Fri, 28 May 2021 21:06:59 -0400
Subject: [PATCH] Missing Entity Behavior 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
+++ b/src/main/java/org/bukkit/entity/Cat.java
@@ -0,0 +0,0 @@ public interface Cat extends Tameable, Sittable {
JELLIE,
ALL_BLACK;
}
+
+ // Paper Start - More cat api
+ /**
+ * Sets if the cat is lying down.
+ * This is visual and does not affect the behaviour of the cat.
+ *
+ * @param lyingDown whether the cat should lie down
+ */
+ public void setLyingDown(boolean lyingDown);
+
+ /**
+ * Gets if the cat is lying down.
+ *
+ * @return whether the cat is lying down
+ */
+ public boolean isLyingDown();
+
+ /**
+ * Sets if the cat has its head up.
+ * This is visual and does not affect the behaviour of the cat.
+ *
+ * @param headUp head is up
+ */
+ public void setHeadUp(boolean headUp);
+
+ /**
+ * Gets if the cat has its head up.
+ *
+ * @return head is up
+ */
+ public boolean isHeadUp();
+ // Paper End - More cat api
}
diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Fox.java

Datei anzeigen

@ -4,6 +4,36 @@ 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/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
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
@@ -0,0 +0,0 @@ public class CraftCat extends CraftTameableAnimal implements Cat {
public void setCollarColor(DyeColor color) {
this.getHandle().setCollarColor(net.minecraft.world.item.DyeColor.byId(color.getWoolData()));
}
+ // Paper Start - More cat api
+ @Override
+ public void setLyingDown(boolean lyingDown) {
+ this.getHandle().setLying(lyingDown);
+ }
+
+ @Override
+ public boolean isLyingDown() {
+ return this.getHandle().isLying();
+ }
+
+ @Override
+ public void setHeadUp(boolean headUp) {
+ this.getHandle().setRelaxStateOne(headUp);
+ }
+
+ @Override
+ public boolean isHeadUp() {
+ return this.getHandle().isRelaxStateOne();
+ }
+ // Paper End - More cat api
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
@ -15,42 +45,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Add more fox behavior API
+ @Override
+ public void setInterested(boolean interested) {
+ getHandle().setIsInterested(interested);
+ this.getHandle().setIsInterested(interested);
+ }
+
+ @Override
+ public boolean isInterested() {
+ return getHandle().isInterested();
+ return this.getHandle().isInterested();
+ }
+
+ @Override
+ public void setLeaping(boolean leaping) {
+ getHandle().setIsPouncing(leaping);
+ this.getHandle().setIsPouncing(leaping);
+ }
+
+ @Override
+ public boolean isLeaping() {
+ return getHandle().isPouncing();
+ return this.getHandle().isPouncing();
+ }
+
+ @Override
+ public void setDefending(boolean defending) {
+ getHandle().setDefending(defending);
+ this.getHandle().setDefending(defending);
+ }
+
+ @Override
+ public boolean isDefending() {
+ return getHandle().isDefending();
+ return this.getHandle().isDefending();
+ }
+
+ @Override
+ public void setFaceplanted(boolean faceplanted) {
+ getHandle().setFaceplanted(faceplanted);
+ this.getHandle().setFaceplanted(faceplanted);
+ }
+
+ @Override
+ public boolean isFaceplanted() {
+ return getHandle().isFaceplanted();
+ return this.getHandle().isFaceplanted();
+ }
+ // Paper end - Add more fox behavior API
}