Skip to content

Commit

Permalink
Slightly less horrific code, it's all isolated to one file now
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiboo committed Jan 18, 2024
1 parent 9dc18f2 commit bbab883
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,18 @@ private static List<BakedQuad> getMissingQuads(BlockRenderDispatcher dispatcher,

public static void renderChunk(
// Params
ChunkBuildContext buildContext, CancellationToken cancellationToken,
/*ChunkBuildContext*/ Object buildContext, /*CancellationToken*/ Object cancellationToken,
// Local variables
BuiltSectionInfo.Builder renderData,
/*BuiltSectionInfo.Builder*/ Object renderData,
VisGraph occluder,
ChunkBuildBuffers buffers,
BlockRenderCache cache,
WorldSlice slice,
/*ChunkBuildBuffers*/ Object buffers,
/*BlockRenderCache*/ Object cache,
/*WorldSlice*/ Object slice,
int minX, int minY, int minZ,
int maxX, int maxY, int maxZ,
BlockPos.MutableBlockPos blockPos,
BlockPos.MutableBlockPos modelOffset,
BlockRenderContext context
/*BlockRenderContext*/ Object context
) {
if (NoCubesConfig.Client.debugSkipNoCubesRendering)
return;
Expand All @@ -311,18 +311,18 @@ public static void renderChunk(
renderChunkMesh(

// Params
buildContext, cancellationToken,
(ChunkBuildContext) buildContext, (CancellationToken) cancellationToken,
// Local variables
renderData,
(BuiltSectionInfo.Builder) renderData,
occluder,
buffers,
cache,
slice,
(ChunkBuildBuffers) buffers,
(BlockRenderCache) cache,
(WorldSlice) slice,
minX, minY, minZ,
maxX, maxY, maxZ,
blockPos,
modelOffset,
context
(BlockRenderContext) context

, light, isSmoothable
);
Expand Down
19 changes: 6 additions & 13 deletions src/main/java/io/github/cadiboo/nocubes/hooks/Hooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
import io.github.cadiboo.nocubes.collision.CollisionHandler;
import io.github.cadiboo.nocubes.config.NoCubesConfig;
import io.github.cadiboo.nocubes.util.ModUtil;
import me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuildBuffers;
import me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuildContext;
import me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderCache;
import me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderContext;
import me.jellysquid.mods.sodium.client.render.chunk.data.BuiltSectionInfo;
import me.jellysquid.mods.sodium.client.util.task.CancellationToken;
import me.jellysquid.mods.sodium.client.world.WorldSlice;
import net.minecraft.client.renderer.ChunkBufferBuilderPack;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
Expand Down Expand Up @@ -103,18 +96,18 @@ public static void preIterationSodium(
SelfCheck.preIterationSodium = true;
SodiumRenderer.renderChunk(
// Params
(ChunkBuildContext) buildContext, (CancellationToken) cancellationToken,
buildContext, cancellationToken,
// Local variables
(BuiltSectionInfo.Builder) renderData,
renderData,
occluder,
(ChunkBuildBuffers) buffers,
(BlockRenderCache) cache,
(WorldSlice) slice,
buffers,
cache,
slice,
minX, minY, minZ,
maxX, maxY, maxZ,
blockPos,
modelOffset,
(BlockRenderContext) context
context
);
}

Expand Down

0 comments on commit bbab883

Please sign in to comment.