generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sodium compat mixins to internal change
- Loading branch information
1 parent
8fe9049
commit 3ae9d60
Showing
3 changed files
with
35 additions
and
27 deletions.
There are no files selected for viewing
26 changes: 0 additions & 26 deletions
26
...ury/simply_no_shading/mixin/client/shading/cloud/sodium/CloudRenderer$CloudFaceMixin.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
...startsmercury/simply_no_shading/mixin/client/shading/cloud/sodium/CloudRendererMixin.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,34 @@ | ||
package io.github.startsmercury.simply_no_shading.mixin.client.shading.cloud.sodium; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import io.github.startsmercury.simply_no_shading.impl.client.ComputedConfig; | ||
import net.caffeinemc.mods.sodium.client.render.immediate.CloudRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(CloudRenderer.class) | ||
public abstract class CloudRendererMixin { | ||
private CloudRendererMixin() { | ||
} | ||
|
||
@WrapOperation( | ||
method = { "emitCellGeometryExterior", "emitCellGeometryInterior" }, | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/caffeinemc/mods/sodium/api/util/ColorABGR;mulRGB(II)I" | ||
), | ||
remap = false | ||
) | ||
private static int changeCloudColor( | ||
final int color, | ||
final int factor, | ||
final Operation<Integer> original | ||
) { | ||
if (ComputedConfig.cloudShadingEnabled) { | ||
return original.call(color, factor); | ||
} else { | ||
return color; | ||
} | ||
} | ||
} |
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