From 259cb3ebbc2f760b976ed15e070c869a69227f61 Mon Sep 17 00:00:00 2001 From: MC_XiaoHei Date: Sun, 18 May 2025 09:26:12 +0000 Subject: [PATCH] fix: make cce possible again --- .../0108-Old-BlockEntity-behaviour.patch | 24 +++++++++++++++++++ ...lock-entity-and-entity-crash-at-Leve.patch | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/leaves-server/minecraft-patches/features/0108-Old-BlockEntity-behaviour.patch b/leaves-server/minecraft-patches/features/0108-Old-BlockEntity-behaviour.patch index c6092d0b..62c83117 100644 --- a/leaves-server/minecraft-patches/features/0108-Old-BlockEntity-behaviour.patch +++ b/leaves-server/minecraft-patches/features/0108-Old-BlockEntity-behaviour.patch @@ -125,3 +125,27 @@ index bbb1abfbfe7afd7b631cf269c1e338697cd016d2..8ec5731b0cfd5b987cb464d7b2d737f3 // CraftBukkit start protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston, @Nullable net.minecraft.world.item.context.UseOnContext context) { this.onPlace(state, level, pos, oldState, movedByPiston); +diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java +index 9714752bfe7019b2578b3b993801d797d642ff96..5f498005408ac11eb373e42712c26a4a66f7d961 100644 +--- a/net/minecraft/world/level/chunk/LevelChunk.java ++++ b/net/minecraft/world/level/chunk/LevelChunk.java +@@ -394,6 +394,10 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + boolean flag = !blockState.is(block); + boolean flag1 = (flags & 64) != 0; + boolean flag2 = (flags & 256) == 0; ++ // Leaves start - behaviour 1.21.4- ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.oldBlockEntityBehaviour && (flag || block instanceof BaseRailBlock) && this.level instanceof ServerLevel serverLevel && ((flags & 1) != 0 || flag1)) { ++ blockState.affectNeighborsAfterRemoval(serverLevel, pos, flag1); ++ } // Leaves end - behaviour 1.21.4- + if (flag && blockState.hasBlockEntity()) { + if (!this.level.isClientSide && flag2) { + BlockEntity blockEntity = this.level.getBlockEntity(pos); +@@ -405,7 +409,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + this.removeBlockEntity(pos); + } + +- if ((flag || block instanceof BaseRailBlock) && this.level instanceof ServerLevel serverLevel && ((flags & 1) != 0 || flag1)) { ++ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.oldBlockEntityBehaviour && (flag || block instanceof BaseRailBlock) && this.level instanceof ServerLevel serverLevel && ((flags & 1) != 0 || flag1)) { // Leaves - behaviour 1.21.4- + blockState.affectNeighborsAfterRemoval(serverLevel, pos, flag1); + } + diff --git a/leaves-server/minecraft-patches/features/0125-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch b/leaves-server/minecraft-patches/features/0125-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch index bb4f4d53..80d50775 100644 --- a/leaves-server/minecraft-patches/features/0125-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch +++ b/leaves-server/minecraft-patches/features/0125-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not prevent block entity and entity crash at LevelChunk diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 9714752bfe7019b2578b3b993801d797d642ff96..3b866f4cd08134406c59c6ed71a648f00e643554 100644 +index 5f498005408ac11eb373e42712c26a4a66f7d961..5f0abcbd4d53d7aa909aa29b891e0df3ac872c13 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java -@@ -938,12 +938,14 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -942,12 +942,14 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p profilerFiller.pop(); } catch (Throwable var5) {