diff --git a/src/main/java/one/oktw/galaxy/mixin/tweak/MixinAsyncChunk_ServerChunkManager.java b/src/main/java/one/oktw/galaxy/mixin/tweak/MixinAsyncChunk_ServerChunkManager.java index 98e65cbcf..c24677d4c 100644 --- a/src/main/java/one/oktw/galaxy/mixin/tweak/MixinAsyncChunk_ServerChunkManager.java +++ b/src/main/java/one/oktw/galaxy/mixin/tweak/MixinAsyncChunk_ServerChunkManager.java @@ -18,18 +18,16 @@ package one.oktw.galaxy.mixin.tweak; -import net.minecraft.server.world.ChunkHolder; -import net.minecraft.server.world.ServerChunkLoadingManager; -import net.minecraft.server.world.ServerChunkManager; -import net.minecraft.server.world.ServerWorld; +import net.minecraft.server.world.*; import net.minecraft.util.math.ChunkPos; -import net.minecraft.world.chunk.ChunkGenerationStep; -import net.minecraft.world.chunk.ChunkGenerationSteps; import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.chunk.WorldChunk; import one.oktw.galaxy.mixin.accessor.ServerChunkLoadingManagerAccessor; import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; @@ -38,10 +36,6 @@ @Mixin(ServerChunkManager.class) public abstract class MixinAsyncChunk_ServerChunkManager { - // From ChunkLevels.class - @Unique - private static final ChunkGenerationStep FULL_GENERATION_STEP = ChunkGenerationSteps.GENERATION.get(ChunkStatus.FULL); - @Shadow @Final ServerWorld world; @@ -59,7 +53,7 @@ public abstract class MixinAsyncChunk_ServerChunkManager { */ @Overwrite public boolean isChunkLoaded(int x, int z) { - return !this.isMissingForLevel(this.getChunkHolder(ChunkPos.toLong(x, z)), 33 + FULL_GENERATION_STEP.getAdditionalLevel(ChunkStatus.FULL)); + return !this.isMissingForLevel(this.getChunkHolder(ChunkPos.toLong(x, z)), ChunkLevels.getLevelFromStatus(ChunkStatus.FULL)); } @Redirect(method = "tickChunks", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerChunkLoadingManager;entryIterator()Ljava/lang/Iterable;"))