Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-14 18:40:10 +01:00
Add more fox API (#5743)
Dieser Commit ist enthalten in:
Ursprung
ae95311131
Commit
aed4433aca
@ -215,3 +215,11 @@ public net.minecraft.world.entity.monster.Witch usingTime
|
|||||||
|
|
||||||
# PlayerDeathEvent#getItemsToKeep
|
# PlayerDeathEvent#getItemsToKeep
|
||||||
public net.minecraft.world.entity.player.Inventory compartments
|
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
|
||||||
|
|
||||||
|
73
patches/api/0320-Missing-Entity-Behavior-API.patch
Normale Datei
73
patches/api/0320-Missing-Entity-Behavior-API.patch
Normale Datei
@ -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
|
||||||
|
}
|
56
patches/server/0718-Missing-Entity-Behavior-API.patch
Normale Datei
56
patches/server/0718-Missing-Entity-Behavior-API.patch
Normale Datei
@ -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
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren