From 1c7adf74e45bb83545603c1e4b7974ad979c442c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 22 Jul 2018 19:35:42 +1000 Subject: Always return captured tiles from chunks as well. Missed in 22c613d8690880ca7d269db709054b4886429d98 Fixes replacing tile entities in BlockPlaceEvent (or calling setBlockData on them) --- nms-patches/Chunk.patch | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/nms-patches/Chunk.patch b/nms-patches/Chunk.patch index 7159a34c..cc5917d3 100644 --- a/nms-patches/Chunk.patch +++ b/nms-patches/Chunk.patch @@ -90,16 +90,13 @@ iblockdata.onPlace(this.world, blockposition, iblockdata1); } -@@ -654,7 +695,15 @@ +@@ -654,7 +695,12 @@ @Nullable public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { - TileEntity tileentity = (TileEntity) this.tileEntities.get(blockposition); + // CraftBukkit start -+ TileEntity tileentity = null; -+ if (world.captureBlockStates) { -+ tileentity = world.capturedTileEntities.get(blockposition); -+ } ++ TileEntity tileentity = world.capturedTileEntities.get(blockposition); + if (tileentity == null) { + tileentity = (TileEntity) this.tileEntities.get(blockposition); + } @@ -107,7 +104,7 @@ if (tileentity == null) { if (chunk_enumtileentitystate == Chunk.EnumTileEntityState.IMMEDIATE) { -@@ -689,6 +738,13 @@ +@@ -689,6 +735,13 @@ tileentity.z(); this.tileEntities.put(blockposition, tileentity); @@ -121,7 +118,7 @@ } } -@@ -735,9 +791,21 @@ +@@ -735,9 +788,21 @@ int i = aentityslice.length; for (int j = 0; j < i; ++j) { @@ -145,7 +142,7 @@ } } -@@ -799,8 +867,8 @@ +@@ -799,8 +864,8 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -156,7 +153,7 @@ } } } -@@ -1006,13 +1074,13 @@ +@@ -1006,13 +1071,13 @@ @Nullable public LongSet b(String s) { @@ -172,7 +169,7 @@ return new LongOpenHashSet(); })).add(i); } -@@ -1061,14 +1129,14 @@ +@@ -1061,14 +1126,14 @@ } if (this.t instanceof ProtoChunkTickList) { -- cgit v1.2.3