From 5da42b1fb26481c9bcec9b6f01c664deb58d36ad Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 17:22:38 -0400 Subject: [PATCH] Fix Tile Entities - #1192 Fixed --- ...Lookups-for-Entity-TileEntity-Current-Ch.patch | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Spigot-Server-Patches/0326-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/0326-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index a050498cff..78d1380e7f 100644 --- a/Spigot-Server-Patches/0326-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/0326-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -1,4 +1,4 @@ -From 617df7f96ccc3f78fb180a4160fe637a89510f92 Mon Sep 17 00:00:00 2001 +From 4cf1cb342584e61ede86313ca6134a164bb14aad Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 03:39:51 -0400 Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current 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..36818bf55 100644 +index c0816b9f8..bd15f0588 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1511,12 +1511,15 @@ public abstract class World implements IBlockAccess { @@ -83,21 +83,18 @@ index c0816b9f8..36818bf55 100644 this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); } } -@@ -1684,8 +1695,11 @@ public abstract class World implements IBlockAccess { +@@ -1684,8 +1695,10 @@ public abstract class World implements IBlockAccess { } // CraftBukkit end */ -- if (this.isLoaded(tileentity1.getPosition())) { -- Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); + // Paper -+ net.minecraft.server.Chunk chunk = tileentity1.getCurrentChunk(); -+ if (chunk != null) { -+ //Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); + if (this.isLoaded(tileentity1.getPosition())) { + Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); + // Paper end IBlockData iblockdata = chunk.getBlockData(tileentity1.getPosition()); chunk.a(tileentity1.getPosition(), tileentity1); -@@ -1805,8 +1819,11 @@ public abstract class World implements IBlockAccess { +@@ -1805,8 +1818,11 @@ 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) {