Try to get the chunk at all costs
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
package me.cortex.voxy.client;
|
||||||
|
|
||||||
|
import net.minecraft.world.chunk.WorldChunk;
|
||||||
|
|
||||||
|
public interface ICheekyClientChunkManager {
|
||||||
|
WorldChunk voxy$cheekyGetChunk(int x, int z);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package me.cortex.voxy.client.mixin.minecraft;
|
||||||
|
|
||||||
|
import me.cortex.voxy.client.ICheekyClientChunkManager;
|
||||||
|
import net.minecraft.client.world.ClientChunkManager;
|
||||||
|
import net.minecraft.world.chunk.WorldChunk;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
@Mixin(ClientChunkManager.class)
|
||||||
|
public class MixinClientChunkManager implements ICheekyClientChunkManager {
|
||||||
|
@Shadow volatile ClientChunkManager.ClientChunkMap chunks;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WorldChunk voxy$cheekyGetChunk(int x, int z) {
|
||||||
|
//This doesnt do the in range check stuff, it just gets the chunk at all costs
|
||||||
|
return this.chunks.getChunk(this.chunks.getIndex(x, z));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package me.cortex.voxy.client.mixin.sodium;
|
package me.cortex.voxy.client.mixin.sodium;
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import me.cortex.voxy.client.ICheekyClientChunkManager;
|
||||||
import me.cortex.voxy.client.VoxyClientInstance;
|
import me.cortex.voxy.client.VoxyClientInstance;
|
||||||
import me.cortex.voxy.client.config.VoxyConfig;
|
import me.cortex.voxy.client.config.VoxyConfig;
|
||||||
import me.cortex.voxy.client.core.IGetVoxyRenderSystem;
|
import me.cortex.voxy.client.core.IGetVoxyRenderSystem;
|
||||||
@@ -65,7 +66,13 @@ public class MixinRenderSectionManager {
|
|||||||
private void injectIngest(int x, int z, CallbackInfo ci) {
|
private void injectIngest(int x, int z, CallbackInfo ci) {
|
||||||
//TODO: Am not quite sure if this is right
|
//TODO: Am not quite sure if this is right
|
||||||
if (VoxyConfig.CONFIG.ingestEnabled) {
|
if (VoxyConfig.CONFIG.ingestEnabled) {
|
||||||
VoxelIngestService.tryAutoIngestChunk(this.level.getChunk(x, z));
|
var cccm = (ICheekyClientChunkManager)this.level.getChunkManager();
|
||||||
|
if (cccm != null) {
|
||||||
|
var chunk = cccm.voxy$cheekyGetChunk(x, z);
|
||||||
|
if (chunk != null) {
|
||||||
|
VoxelIngestService.tryAutoIngestChunk(chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"package": "me.cortex.voxy.client.mixin",
|
"package": "me.cortex.voxy.client.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"client": [
|
"client": [
|
||||||
|
"minecraft.MixinClientChunkManager",
|
||||||
"minecraft.MixinClientCommonNetworkHandler",
|
"minecraft.MixinClientCommonNetworkHandler",
|
||||||
"minecraft.MixinClientLoginNetworkHandler",
|
"minecraft.MixinClientLoginNetworkHandler",
|
||||||
"minecraft.MixinDebugHud",
|
"minecraft.MixinDebugHud",
|
||||||
@@ -12,10 +13,10 @@
|
|||||||
"minecraft.MixinThreadExecutor",
|
"minecraft.MixinThreadExecutor",
|
||||||
"minecraft.MixinWindow",
|
"minecraft.MixinWindow",
|
||||||
"minecraft.MixinWorldRenderer",
|
"minecraft.MixinWorldRenderer",
|
||||||
|
"nvidium.MixinRenderPipeline",
|
||||||
"sodium.MixinDefaultChunkRenderer",
|
"sodium.MixinDefaultChunkRenderer",
|
||||||
"sodium.MixinRenderSectionManager",
|
"sodium.MixinRenderSectionManager",
|
||||||
"sodium.MixinSodiumOptionsGUI",
|
"sodium.MixinSodiumOptionsGUI"
|
||||||
"nvidium.MixinRenderPipeline"
|
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
@@ -28,3 +28,7 @@ accessible field net/minecraft/client/gl/GlCommandEncoder currentProgram Lnet/mi
|
|||||||
accessible field net/minecraft/client/gl/GlCommandEncoder currentPipeline Lcom/mojang/blaze3d/pipeline/RenderPipeline;
|
accessible field net/minecraft/client/gl/GlCommandEncoder currentPipeline Lcom/mojang/blaze3d/pipeline/RenderPipeline;
|
||||||
|
|
||||||
accessible class net/minecraft/client/gl/GlDebug$DebugMessage
|
accessible class net/minecraft/client/gl/GlDebug$DebugMessage
|
||||||
|
|
||||||
|
accessible class net/minecraft/client/world/ClientChunkManager$ClientChunkMap
|
||||||
|
accessible method net/minecraft/client/world/ClientChunkManager$ClientChunkMap getChunk (I)Lnet/minecraft/world/chunk/WorldChunk;
|
||||||
|
accessible method net/minecraft/client/world/ClientChunkManager$ClientChunkMap getIndex (II)I
|
||||||
Reference in New Issue
Block a user