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.
This commit is contained in:
Shane Freeder 2017-10-31 15:13:55 +00:00
parent 8381709166
commit 4c71520375
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
1 changed files with 4 additions and 4 deletions

View File

@ -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 <zach.brown@destroystokyo.com>
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