Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically disable block face culling for ships on Sodium #1004

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.valkyrienskies.mod.mixin.mod_compat.sodium;

import me.jellysquid.mods.sodium.client.model.quad.properties.ModelQuadFacing;
import me.jellysquid.mods.sodium.client.render.chunk.DefaultChunkRenderer;
import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.valkyrienskies.mod.common.VSGameUtilsKt;

@Mixin(DefaultChunkRenderer.class)
public abstract class MixinDefaultChunkRenderer {
@Inject(
method = "getVisibleFaces",
at = @At("HEAD"),
cancellable = true,
remap = false
)
private static void cancelBlockFaceCulling(final int originX, final int originY, final int originZ, final int chunkX, final int chunkY, final int chunkZ, final CallbackInfoReturnable<Integer> cir) {
if(VSGameUtilsKt.isChunkInShipyard(Minecraft.getInstance().level, chunkX, chunkZ))
cir.setReturnValue(ModelQuadFacing.ALL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
"mod_compat.optifine.RenderChunkInfoAccessorOptifine",
"mod_compat.optifine_vanilla.MixinLevelRenderer",
"mod_compat.sodium.MixinChunkTracker",
"mod_compat.sodium.MixinDefaultChunkRenderer",
"mod_compat.sodium.MixinRenderSectionManager",
"mod_compat.sodium.MixinSodiumWorldRenderer",
"mod_compat.sound_physics_remastered.MixinSoundPhysics",
Expand Down
Loading