From 9a6e5ca50d066a1323424a51a3e7ddabdc0aec09 Mon Sep 17 00:00:00 2001 From: ishland Date: Fri, 24 Jan 2025 23:05:05 +0800 Subject: [PATCH] fix: don't duplicate suppressGhostMushrooms --- ....4-MixinServerAccessibleChunkSending.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/patches/main/0016-change-sync-1.21.4-MixinServerAccessibleChunkSending.patch b/patches/main/0016-change-sync-1.21.4-MixinServerAccessibleChunkSending.patch index a22c4bb..0671ea8 100644 --- a/patches/main/0016-change-sync-1.21.4-MixinServerAccessibleChunkSending.patch +++ b/patches/main/0016-change-sync-1.21.4-MixinServerAccessibleChunkSending.patch @@ -99,6 +99,43 @@ index 4bb24b66..21ada3b6 100644 } @Unique +diff --git a/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/statuses/ServerAccessible.java b/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/statuses/ServerAccessible.java +index efc8596a..b973b73a 100644 +--- a/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/statuses/ServerAccessible.java ++++ b/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/statuses/ServerAccessible.java +@@ -45,32 +45,6 @@ public class ServerAccessible extends NewChunkStatus { + Preconditions.checkState(chunk instanceof ProtoChunk, "Chunk must be a proto chunk"); + ProtoChunk protoChunk = (ProtoChunk) chunk; + +- if (Config.suppressGhostMushrooms) { +- try (var ignored = ThreadInstrumentation.getCurrent().begin(new ChunkTaskWork(context, this, true))) { +- ServerWorld serverWorld = ((IThreadedAnvilChunkStorage) context.tacs()).getWorld(); +- ChunkRegion chunkRegion = new ChunkRegion(serverWorld, context.chunks(), ChunkGenerationSteps.GENERATION.get(ChunkStatus.FULL), chunk); +- +- ChunkPos chunkPos = context.holder().getKey(); +- +- ShortList[] postProcessingLists = protoChunk.getPostProcessingLists(); +- for (int i = 0; i < postProcessingLists.length; i++) { +- if (postProcessingLists[i] != null) { +- for (ShortListIterator iterator = postProcessingLists[i].iterator(); iterator.hasNext(); ) { +- short short_ = iterator.nextShort(); +- BlockPos blockPos = ProtoChunk.joinBlockPos(short_, protoChunk.sectionIndexToCoord(i), chunkPos); +- BlockState blockState = protoChunk.getBlockState(blockPos); +- +- if (blockState.getBlock() == Blocks.BROWN_MUSHROOM || blockState.getBlock() == Blocks.RED_MUSHROOM) { +- if (!blockState.canPlaceAt(chunkRegion, blockPos)) { +- protoChunk.setBlockState(blockPos, Blocks.AIR.getDefaultState(), false); // TODO depends on the fact that the chunk system always locks the current chunk +- } +- } +- } +- } +- } +- } +- } +- + return CompletableFuture.runAsync(() -> { + try (var ignored = ThreadInstrumentation.getCurrent().begin(new ChunkTaskWork(context, this, true))) { + ServerWorld serverWorld = ((IThreadedAnvilChunkStorage) context.tacs()).getWorld(); diff --git a/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/mixin/MixinWorldChunk.java b/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/mixin/MixinWorldChunk.java deleted file mode 100644 index 7746bcbc..00000000