From 4c715203757c9a70267a4308f6666524868ffb66 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 31 Oct 2017 15:13:55 +0000 Subject: [PATCH] allow nerfed mobs to jump again Entity AI tasks are initialized earlier in recent versions of MC, this means that the fromMobSpawner has not been set at the point where AI tasks are initilazed and so the goalFloat will never be populated. To rectify this, we can rely on the entity tick checking if the mob is from a spawner each tick, and just initialize the field should the paper option be enabled. This saves us from having to modify the call chain in order to pass the fact that it was created by a mobSpawner earlier. --- .../0011-Allow-nerfed-mobs-to-jump.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/0011-Allow-nerfed-mobs-to-jump.patch b/Spigot-Server-Patches/0011-Allow-nerfed-mobs-to-jump.patch index eca56c9f27..e0d65753da 100644 --- a/Spigot-Server-Patches/0011-Allow-nerfed-mobs-to-jump.patch +++ b/Spigot-Server-Patches/0011-Allow-nerfed-mobs-to-jump.patch @@ -1,4 +1,4 @@ -From 97ddf652daa2df0abdac972daa33a2bc9c3d3e85 Mon Sep 17 00:00:00 2001 +From 65725cb96944989051fc5bf381b31cff4967682b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 13:24:16 -0600 Subject: [PATCH] Allow nerfed mobs to jump @@ -56,14 +56,14 @@ index 3c48d9463..7b02b253c 100644 } // Spigot End diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java -index b3b303b3b..fc8be86fd 100644 +index b3b303b3b..fc6c3bf71 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java @@ -6,6 +6,7 @@ public class PathfinderGoalFloat extends PathfinderGoal { public PathfinderGoalFloat(EntityInsentient entityinsentient) { this.a = entityinsentient; -+ if (entityinsentient.fromMobSpawner && entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper ++ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper this.a(4); if (entityinsentient.getNavigation() instanceof Navigation) { ((Navigation) entityinsentient.getNavigation()).c(true); @@ -81,5 +81,5 @@ index b3b303b3b..fc8be86fd 100644 if (this.a.getRandom().nextFloat() < 0.8F) { this.a.getControllerJump().a(); -- -2.13.3 +2.14.3