From 4624f313ca52383340881ab662b6ac588bb0aeea Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 11 Mar 2024 15:03:33 +1100 Subject: [PATCH] SPIGOT-7593: Fix sapling growth physics / client-side updates By: md_5 --- .../net/minecraft/world/level/World.patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/world/level/World.patch b/paper-server/nms-patches/net/minecraft/world/level/World.patch index 4fb42ae72c..2812a0ec6a 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/World.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/World.patch @@ -135,7 +135,7 @@ } @Override -@@ -207,6 +304,17 @@ +@@ -207,6 +304,18 @@ @Override public boolean setBlock(BlockPosition blockposition, IBlockData iblockdata, int i, int j) { @@ -147,13 +147,14 @@ + this.capturedBlockStates.put(blockposition.immutable(), blockstate); + } + blockstate.setData(iblockdata); ++ blockstate.setFlag(i); + return true; + } + // CraftBukkit end if (this.isOutsideBuildHeight(blockposition)) { return false; } else if (!this.isClientSide && this.isDebug()) { -@@ -214,13 +322,29 @@ +@@ -214,13 +323,29 @@ } else { Chunk chunk = this.getChunkAt(blockposition); Block block = iblockdata.getBlock(); @@ -184,7 +185,7 @@ if (iblockdata2 == iblockdata) { if (iblockdata1 != iblockdata2) { this.setBlocksDirty(blockposition, iblockdata1, iblockdata2); -@@ -247,12 +371,69 @@ +@@ -247,12 +372,69 @@ this.onBlockStateChange(blockposition, iblockdata1, iblockdata2); } @@ -254,7 +255,7 @@ public void onBlockStateChange(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} @Override -@@ -338,6 +519,14 @@ +@@ -338,6 +520,14 @@ @Override public IBlockData getBlockState(BlockPosition blockposition) { @@ -269,7 +270,7 @@ if (this.isOutsideBuildHeight(blockposition)) { return Blocks.VOID_AIR.defaultBlockState(); } else { -@@ -543,6 +732,16 @@ +@@ -543,6 +733,16 @@ @Nullable @Override public TileEntity getBlockEntity(BlockPosition blockposition) { @@ -286,7 +287,7 @@ return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE)); } -@@ -550,6 +749,12 @@ +@@ -550,6 +750,12 @@ BlockPosition blockposition = tileentity.getBlockPos(); if (!this.isOutsideBuildHeight(blockposition)) { @@ -299,7 +300,7 @@ this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity); } } -@@ -680,7 +885,7 @@ +@@ -680,7 +886,7 @@ for (int k = 0; k < j; ++k) { EntityComplexPart entitycomplexpart = aentitycomplexpart[k];