From e383b8e15dc79c60e507b48e484ddb7be88a9bf0 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Fri, 9 Dec 2022 19:56:13 -0500 Subject: [PATCH] Rabbit API (#8627) --- patches/api/Missing-Entity-Behavior-API.patch | 28 +++++++++++++++++++ .../server/Missing-Entity-Behavior-API.patch | 21 ++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/patches/api/Missing-Entity-Behavior-API.patch b/patches/api/Missing-Entity-Behavior-API.patch index 2d41ab568b..473e2452d2 100644 --- a/patches/api/Missing-Entity-Behavior-API.patch +++ b/patches/api/Missing-Entity-Behavior-API.patch @@ -766,6 +766,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +} +// Paper end +diff --git a/src/main/java/org/bukkit/entity/Rabbit.java b/src/main/java/org/bukkit/entity/Rabbit.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Rabbit.java ++++ b/src/main/java/org/bukkit/entity/Rabbit.java +@@ -0,0 +0,0 @@ public interface Rabbit extends Animals { + * @param type Sets the type of rabbit for this entity. + */ + public void setRabbitType(@NotNull Type type); ++ // Paper start ++ /** ++ * Sets how many ticks this rabbit will wait ++ * until trying to find more carrots. ++ * ++ * @param ticks ticks ++ */ ++ void setMoreCarrotTicks(int ticks); ++ ++ /** ++ * Returns how many ticks this rabbit ++ * will wait until trying to find more carrots. ++ * ++ * @return ticks ++ */ ++ int getMoreCarrotTicks(); ++ // Paper end + + /** + * Represents the various types a Rabbit might be. diff --git a/src/main/java/org/bukkit/entity/Raider.java b/src/main/java/org/bukkit/entity/Raider.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Raider.java diff --git a/patches/server/Missing-Entity-Behavior-API.patch b/patches/server/Missing-Entity-Behavior-API.patch index d7cdcbd868..1d384ef01d 100644 --- a/patches/server/Missing-Entity-Behavior-API.patch +++ b/patches/server/Missing-Entity-Behavior-API.patch @@ -28,6 +28,7 @@ public net.minecraft.world.entity.monster.Phantom anchorPoint public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos; public net.minecraft.world.entity.animal.AbstractSchoolingFish leader public net.minecraft.world.entity.animal.AbstractSchoolingFish schoolSize +public net.minecraft.world.entity.animal.Rabbit moreCarrotTicks Co-authored-by: Nassim Jahnke Co-authored-by: Jake Potrebic @@ -908,6 +909,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void setStanding(boolean standing) { + this.getHandle().setStanding(standing); + } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +@@ -0,0 +0,0 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { + + entity.setVariant(net.minecraft.world.entity.animal.Rabbit.Variant.values()[type.ordinal()]); + } ++ // Paper start ++ @Override ++ public void setMoreCarrotTicks(int ticks) { ++ this.getHandle().moreCarrotTicks = ticks; ++ } ++ ++ @Override ++ public int getMoreCarrotTicks() { ++ return this.getHandle().moreCarrotTicks; ++ } + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java