From 8247f5f2154e508bc1b4dc596305df099cb7ae66 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 4 Jan 2025 10:50:56 -0600 Subject: [PATCH] add comments to DhLitWorldGenRegion.getBlockTicks() --- .../common/wrappers/chunk/ChunkWrapper.java | 1 + .../mimicObject/DhLitWorldGenRegion.java | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index 04ed16cae..b04137397 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -369,6 +369,7 @@ public class ChunkWrapper implements IChunkWrapper blockPos.setY(relY); blockPos.setZ(relZ); + // TODO copy into pooled array, this isn't thread safe and can cause MC to throw errors if the chunk is loaded return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(blockPos), this.wrappedLevel); } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java index 22ee32275..6875f2285 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/DhLitWorldGenRegion.java @@ -202,15 +202,18 @@ public class DhLitWorldGenRegion extends WorldGenRegion #if MC_VER >= MC_1_18_2 @Override + @NotNull public LevelTickAccess getBlockTicks() { + // DH world gen doesn't need ticking, so return the BlackholeTickAccess list (which causes all ticks to be ignored). + // If this isn't done the server may attempt to tick chunks outside the vanilla render distance, + // which can throw warnings or cause other issues return BlackholeTickAccess.emptyLevelList(); } + @Override - public LevelTickAccess getFluidTicks() - { - return BlackholeTickAccess.emptyLevelList(); - } + @NotNull + public LevelTickAccess getFluidTicks() { return BlackholeTickAccess.emptyLevelList(); } #endif // TODO Check this