From c777e6f25547c951cbe4bb669e7a8bbde23d6ded Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 28 Sep 2018 20:27:40 -0500 Subject: [PATCH] Fix turtle lag (for real this time) (#1503) Amends #1502, to further fix #1501 --- Spigot-Server-Patches/Fix-turtle-lag.patch | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Spigot-Server-Patches/Fix-turtle-lag.patch b/Spigot-Server-Patches/Fix-turtle-lag.patch index ff453ad436..0d350a8877 100644 --- a/Spigot-Server-Patches/Fix-turtle-lag.patch +++ b/Spigot-Server-Patches/Fix-turtle-lag.patch @@ -5,24 +5,25 @@ Subject: [PATCH] Fix turtle lag diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 1b09f577e9..b515eeb230 100644 +index 1b09f577e..4f5592d1c 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { - this.datawatcher.set(EntityTurtle.bI, Boolean.valueOf(flag)); - } + ++this.d; + } -+ private boolean isTravelling() { return dI(); } // Paper - OBFHELPER - private boolean dI() { - return ((Boolean) this.datawatcher.get(EntityTurtle.bJ)).booleanValue(); - } +- if (this.a.dA() || this.a.getNavigation().p()) { ++ if (/*this.a.dA() ||*/ this.a.getNavigation().p()) { // Paper - Fix GH-1501 + Vec3D vec3d = RandomPositionGenerator.a((EntityCreature) this.a, 16, 3, new Vec3D((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()), 0.3141592741012573D); + + if (vec3d == null) { @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { } - public boolean a() { -- return !this.a.dH() && !this.a.dy() && this.a.isInWater(); -+ return !this.a.isTravelling() && !this.a.dH() && !this.a.dy() && this.a.isInWater(); // Paper - } + public void e() { +- if (this.a.dA() || this.a.getNavigation().p()) { ++ if (/*this.a.dA() ||*/ this.a.getNavigation().p()) { // Paper - Fix GH-1501 + BlockPosition blockposition = this.a.dC(); + Vec3D vec3d = RandomPositionGenerator.a((EntityCreature) this.a, 16, 3, new Vec3D((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()), 0.3141592741012573D); - public void c() { -- \ No newline at end of file