From 5ef91b329352f38dc67a1fc98584abefbb9bd839 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 9 Jul 2018 19:48:49 +0100 Subject: [PATCH] hopefully fix entity issues - #1199 @Aikar --- ...kups-for-Entity-TileEntity-Current-Ch.patch | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index 4a9ef8c75b..cdfecbc5d3 100644 --- a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -10,7 +10,7 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 71d0db3f3..a51b648c5 100644 +index 3e80825f7..4a94fd5a6 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk { @@ -22,7 +22,7 @@ index 71d0db3f3..a51b648c5 100644 this.a(entity, entity.ac); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c0816b9f8..b1e7b63e0 100644 +index c0816b9f8..33ac57e6b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -85,18 +85,4 @@ index c0816b9f8..b1e7b63e0 100644 } } } -@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { - int k = MathHelper.floor(entity.locZ / 16.0D); - - if (!entity.aa || entity.ab != i || entity.ac != j || entity.ad != k) { -- if (entity.aa && this.isChunkLoaded(entity.ab, entity.ad, true)) { -- this.getChunkAt(entity.ab, entity.ad).a(entity, entity.ac); -+ // Paper start -+ Chunk currentChunk = entity.getCurrentChunk(); -+ if (entity.aa && currentChunk != null) { -+ currentChunk.removeEntity(entity); -+ // Paper end - } - - if (!entity.bD() && !this.isChunkLoaded(i, k, true)) { -- \ No newline at end of file