forked from ValkyrienSkies/Valkyrien-Skies-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically disable block face culling for ships on Sodium Valkyrie…
1 parent
990eb3f
commit b2029ce
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...c/main/java/org/valkyrienskies/mod/mixin/mod_compat/sodium/MixinDefaultChunkRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters