-
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.
* [Sodium] Fix leaf colours being to bright * [Sodium] Leaves won't turn snowy
- Loading branch information
1 parent
965cd5d
commit 2b71a3c
Showing
11 changed files
with
87 additions
and
30 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
...ves/mixin/client/BlockColorsAccessor.java → ...client/minecraft/BlockColorsAccessor.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
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
2 changes: 1 addition & 1 deletion
2
...mixin/client/ModelBlockRendererMixin.java → ...nt/minecraft/ModelBlockRendererMixin.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
2 changes: 1 addition & 1 deletion
2
...eaves/mixin/client/ModelManagerMixin.java → ...n/client/minecraft/ModelManagerMixin.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
2 changes: 1 addition & 1 deletion
2
...xin/client/RenderChunkRegionAccessor.java → .../minecraft/RenderChunkRegionAccessor.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
2 changes: 1 addition & 1 deletion
2
.../mixin/client/SpriteContentsAccessor.java → ...ent/minecraft/SpriteContentsAccessor.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
2 changes: 1 addition & 1 deletion
2
...es/mixin/client/TerrainParticleMixin.java → ...lient/minecraft/TerrainParticleMixin.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
33 changes: 33 additions & 0 deletions
33
...a/io/github/startsmercury/visual_snowy_leaves/mixin/client/sodium/BlockRendererMixin.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,33 @@ | ||
package io.github.startsmercury.visual_snowy_leaves.mixin.client.sodium; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import io.github.startsmercury.visual_snowy_leaves.impl.client.VisualSnowyLeavesImpl; | ||
import me.jellysquid.mods.sodium.client.model.color.ColorProvider; | ||
import me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderContext; | ||
import me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderer; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(BlockRenderer.class) | ||
public class BlockRendererMixin { | ||
@ModifyExpressionValue( | ||
method = "getVertexColors", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lme/jellysquid/mods/sodium/client/model/quad/BakedQuadView;hasColor()Z" | ||
), | ||
remap = false | ||
) | ||
private boolean modifyColor( | ||
final boolean original, | ||
final @Local(ordinal = 0, argsOnly = true) BlockRenderContext ctx, | ||
final @Local(ordinal = 0, argsOnly = true) ColorProvider<BlockState> provider | ||
) { | ||
final var blockPos = ctx.pos(); | ||
final var blockState = ctx.state(); | ||
final var world = ((WorldSliceAccessor) (Object) ctx.world()).getWorld(); | ||
return !VisualSnowyLeavesImpl.isSnowyAt(world, blockState, blockPos); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...a/io/github/startsmercury/visual_snowy_leaves/mixin/client/sodium/WorldSliceAccessor.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,12 @@ | ||
package io.github.startsmercury.visual_snowy_leaves.mixin.client.sodium; | ||
|
||
import me.jellysquid.mods.sodium.client.world.WorldSlice; | ||
import net.minecraft.client.multiplayer.ClientLevel; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(WorldSlice.class) | ||
public interface WorldSliceAccessor { | ||
@Accessor | ||
ClientLevel getWorld(); | ||
} |
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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
{ | ||
"required": true, | ||
"package": "io.github.startsmercury.visual_snowy_leaves.mixin.client", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"BlockColorsAccessor", | ||
"ModelBakeryMixin", | ||
"ModelBlockRendererMixin", | ||
"ModelManagerMixin", | ||
"RenderChunkRegionAccessor", | ||
"SpriteContentsAccessor", | ||
"TerrainParticleMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
"required": true, | ||
"package": "io.github.startsmercury.visual_snowy_leaves.mixin.client", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"minecraft.BlockColorsAccessor", | ||
"minecraft.ModelBakeryMixin", | ||
"minecraft.ModelBlockRendererMixin", | ||
"minecraft.ModelManagerMixin", | ||
"minecraft.RenderChunkRegionAccessor", | ||
"minecraft.SpriteContentsAccessor", | ||
"minecraft.TerrainParticleMixin", | ||
"sodium.BlockRendererMixin", | ||
"sodium.WorldSliceAccessor" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |