From 0c5da1275df6981fa6b88d5bd65a150245bd10f5 Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Mon, 22 Jun 2026 08:39:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=BA=BF=E7=A8=8B=E9=98=BB=E5=A1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exdeorum/block/AbstractCrucibleBlock.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java b/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java index 2e9775c1..a81a4655 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java @@ -19,6 +19,7 @@ package thedarkcolour.exdeorum.block; import net.minecraft.core.BlockPos; +import net.minecraft.core.SectionPos; import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.BlockGetter; @@ -50,6 +51,16 @@ public abstract class AbstractCrucibleBlock extends ETankBlock { @Override public int getLightEmission(BlockState state, BlockGetter level, BlockPos pos) { + // Only attempt to access the block entity if the chunk is already loaded. + // This prevents getExistingBlockEntity from triggering asynchronous chunk + // loading, which can cause the server to hang during shutdown. + if (level instanceof Level world) { + int chunkX = SectionPos.blockToSectionCoord(pos.getX()); + int chunkZ = SectionPos.blockToSectionCoord(pos.getZ()); + if (!world.hasChunk(chunkX, chunkZ)) { + return 0; + } + } if (level.getExistingBlockEntity(pos) instanceof AbstractCrucibleBlockEntity crucible) { return crucible.getTank().getFluid().getFluid().getFluidType().getLightLevel(); }