From 93cbf5e356886b277b4aff9fecd8eec320ec7326 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 28 Sep 2018 12:58:06 -0500 Subject: [PATCH] Fix turtle lag (#1502) Fix #1501 I just added a condition check to not start a new pathfinder goal if the turtle already has one set. Needs more testing. ![Timings Comparison](https://i.imgur.com/p9eJQSo.png) --- Spigot-Server-Patches/Fix-turtle-lag.patch | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Spigot-Server-Patches/Fix-turtle-lag.patch diff --git a/Spigot-Server-Patches/Fix-turtle-lag.patch b/Spigot-Server-Patches/Fix-turtle-lag.patch new file mode 100644 index 0000000000..8386cde71f --- /dev/null +++ b/Spigot-Server-Patches/Fix-turtle-lag.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Fri, 28 Sep 2018 12:27:54 -0500 +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 1b09f577e..b515eeb23 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)); + } + ++ private boolean isTravelling() { return dI(); } // Paper - OBFHELPER + private boolean dI() { + return ((Boolean) this.datawatcher.get(EntityTurtle.bJ)).booleanValue(); + } +@@ -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 c() { +-- \ No newline at end of file