diff --git a/paper-server/patches/sources/net/minecraft/world/level/Level.java.patch b/paper-server/patches/sources/net/minecraft/world/level/Level.java.patch index 2969e0bb88..581c8e8cf6 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/Level.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/Level.java.patch @@ -284,7 +284,7 @@ if (this.isOutsideBuildHeight(pos)) { return false; } else if (!this.isClientSide && this.isDebug()) { -@@ -214,45 +378,124 @@ +@@ -214,44 +378,123 @@ } else { LevelChunk chunk = this.getChunkAt(pos); Block block = state.getBlock(); @@ -368,10 +368,10 @@ + // CraftBukkit end + return true; - } - } - } - ++ } ++ } ++ } ++ + // CraftBukkit start - Split off from above in order to directly send client and physic updates + public void notifyAndUpdatePhysics(BlockPos blockposition, LevelChunk chunk, BlockState oldBlock, BlockState newBlock, BlockState actualBlock, int i, int j) { + BlockState iblockdata = newBlock; @@ -391,7 +391,7 @@ + if (!this.isClientSide && iblockdata.hasAnalogOutputSignal()) { + this.updateNeighbourForOutputSignal(blockposition, newBlock.getBlock()); + } -+ } + } + + if ((i & 16) == 0 && j > 0) { + int k = i & -34; @@ -417,13 +417,12 @@ + this.onBlockStateChange(blockposition, iblockdata1, iblockdata2); + } + // CraftBukkit end -+ } -+ } + } + } + // CraftBukkit end -+ + public void onBlockStateChange(BlockPos pos, BlockState oldBlock, BlockState newBlock) {} - @Override @@ -340,10 +583,18 @@ @Override @@ -444,7 +443,7 @@ return chunk.getBlockState(pos); } -@@ -446,14 +697,23 @@ +@@ -446,14 +697,21 @@ this.pendingBlockEntityTickers.clear(); } @@ -456,9 +455,7 @@ - while (iterator.hasNext()) { - TickingBlockEntity tickingblockentity = (TickingBlockEntity) iterator.next(); + int tilesThisCycle = 0; -+ for (this.tileLimiter.initTick(); -+ tilesThisCycle < this.blockEntityTickers.size() && (tilesThisCycle % 10 != 0 || this.tileLimiter.shouldContinue()); -+ this.tileTickPosition++, tilesThisCycle++) { ++ for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters + this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; + TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition); + // Spigot end @@ -472,7 +469,7 @@ } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) { tickingblockentity.tick(); } -@@ -461,17 +721,18 @@ +@@ -461,17 +719,18 @@ this.tickingBlockEntities = false; gameprofilerfiller.pop(); @@ -496,7 +493,7 @@ } } -@@ -510,13 +771,29 @@ +@@ -510,13 +769,29 @@ @Nullable @Override public BlockEntity getBlockEntity(BlockPos pos) { @@ -527,7 +524,7 @@ this.getChunkAt(blockposition).addAndRegisterBlockEntity(blockEntity); } } -@@ -643,7 +920,7 @@ +@@ -643,7 +918,7 @@ for (int k = 0; k < j; ++k) { EnderDragonPart entitycomplexpart = aentitycomplexpart[k]; @@ -536,7 +533,7 @@ if (t0 != null && predicate.test(t0)) { result.add(t0); -@@ -912,7 +1189,7 @@ +@@ -912,7 +1187,7 @@ public static enum ExplosionInteraction implements StringRepresentable {