From 60f8a29d129969cb412f9c79c8ada148ca405e51 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 9 Jul 2020 09:04:11 +1000 Subject: [PATCH] SPIGOT-5968: Killer rabbits can't be set to the non-killer rabbit behavior --- nms-patches/EntityRabbit.patch | 8 ++++++-- .../java/org/bukkit/craftbukkit/entity/CraftRabbit.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nms-patches/EntityRabbit.patch b/nms-patches/EntityRabbit.patch index f05dcee267..6b9f7daeed 100644 --- a/nms-patches/EntityRabbit.patch +++ b/nms-patches/EntityRabbit.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/EntityRabbit.java +++ b/net/minecraft/server/EntityRabbit.java -@@ -17,8 +17,14 @@ +@@ -17,11 +17,17 @@ super(entitytypes, world); this.bp = new EntityRabbit.ControllerJumpRabbit(this); this.moveController = new EntityRabbit.ControllerMoveRabbit(this); @@ -14,7 +14,11 @@ + // CraftBukkit end @Override - protected void initPathfinder() { +- protected void initPathfinder() { ++ public void initPathfinder() { + this.goalSelector.a(1, new PathfinderGoalFloat(this)); + this.goalSelector.a(1, new EntityRabbit.PathfinderGoalRabbitPanic(this, 2.2D)); + this.goalSelector.a(2, new PathfinderGoalBreed(this, 0.8D)); @@ -285,7 +291,7 @@ if (i == 99) { this.getAttributeInstance(GenericAttributes.ARMOR).setValue(8.0D); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java index 7dcae39aae..222fe95713 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java @@ -43,6 +43,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { World world = ((CraftWorld) this.getWorld()).getHandle(); entity.goalSelector = new PathfinderGoalSelector(world.getMethodProfilerSupplier()); entity.targetSelector = new PathfinderGoalSelector(world.getMethodProfilerSupplier()); + entity.initPathfinder(); entity.initializePathFinderGoals(); }