From a0512ef044a1a3e82931cbd0b4d1243877e60f53 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 18 Oct 2025 17:30:35 +1000 Subject: [PATCH] Ingest on chunk loaded --- .../sodium/MixinRenderSectionManager.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinRenderSectionManager.java b/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinRenderSectionManager.java index 071dc42b..e681686b 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinRenderSectionManager.java +++ b/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinRenderSectionManager.java @@ -18,6 +18,7 @@ import net.minecraft.client.world.ClientWorld; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkSectionPos; import net.minecraft.world.LightType; +import net.minecraft.world.chunk.ChunkStatus; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -59,16 +60,19 @@ public class MixinRenderSectionManager { } } - /* + @Inject(method = "onChunkAdded", at = @At("HEAD")) - private void voxy$trackChunkAdd(int x, int z, CallbackInfo ci) { - if (this.level.worldRenderer != null) { - var system = ((IGetVoxyRenderSystem)(this.level.worldRenderer)).getVoxyRenderSystem(); - if (system != null) { - system.chunkBoundRenderer.addChunk(ChunkPos.toLong(x, z)); + private void voxy$ingestOnAdd(int x, int z, CallbackInfo ci) { + if (this.level.worldRenderer != null && VoxyConfig.CONFIG.ingestEnabled) { + var cccm = this.level.getChunkManager(); + if (cccm != null) { + var chunk = cccm.getChunk(x, z, ChunkStatus.FULL, false); + if (chunk != null) { + VoxelIngestService.tryAutoIngestChunk(chunk); + } } } - }*/ + } /* @Inject(method = "onChunkRemoved", at = @At("HEAD"))