-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.19.x/dev' into 1.19.x/stable
- Loading branch information
Showing
37 changed files
with
566 additions
and
261 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
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
Binary file not shown.
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,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
28 changes: 0 additions & 28 deletions
28
...a/me/flashyreese/mods/sodiumextra/client/render/terrain/color/LinearFlatColorBlender.java
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
...java/me/flashyreese/mods/sodiumextra/mixin/sodium/biome_blend/MixinBiomeColorBlender.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,54 @@ | ||
package me.flashyreese.mods.sodiumextra.mixin.sodium.biome_blend; | ||
|
||
import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod; | ||
import me.jellysquid.mods.sodium.client.model.quad.ModelQuadView; | ||
import me.jellysquid.mods.sodium.client.model.quad.blender.BiomeColorBlender; | ||
import me.jellysquid.mods.sodium.client.model.quad.blender.ColorSampler; | ||
import net.caffeinemc.mods.sodium.api.util.ColorARGB; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.BlockRenderView; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
import java.util.Arrays; | ||
|
||
@Mixin(value = BiomeColorBlender.class, remap = false) | ||
public abstract class MixinBiomeColorBlender { | ||
@Shadow | ||
@Final | ||
private boolean useSmoothBlending; | ||
@Shadow | ||
@Final | ||
private int[] cachedRet; | ||
|
||
@Shadow | ||
protected abstract <T> void getColorsLinear(BlockRenderView world, BlockPos origin, ModelQuadView quad, ColorSampler<T> sampler, T state, int[] colors); | ||
|
||
/** | ||
* @author FlashyReese | ||
*/ | ||
@Inject(method = "getColors", at = @At(value = "HEAD"), cancellable = true) | ||
private <T> void getColors(BlockRenderView world, BlockPos origin, ModelQuadView quad, ColorSampler<T> sampler, T state, CallbackInfoReturnable<int[]> cir) { | ||
if (this.useSmoothBlending && SodiumExtraClientMod.options().renderSettings.useLinearFlatColorBlender) { | ||
int[] colors = this.cachedRet; | ||
this.getColorsLinearFlat(world, origin, quad, sampler, state, colors); | ||
cir.setReturnValue(colors); | ||
} | ||
} | ||
|
||
private <T> void getColorsLinearFlat(BlockRenderView world, BlockPos origin, ModelQuadView quad, ColorSampler<T> sampler, T state, int[] colors) { | ||
this.getColorsLinear(world, origin, quad, sampler, state, colors); | ||
|
||
int a = Arrays.stream(colors).map(ColorARGB::unpackAlpha).sum(); | ||
int r = Arrays.stream(colors).map(ColorARGB::unpackRed).sum(); | ||
int g = Arrays.stream(colors).map(ColorARGB::unpackGreen).sum(); | ||
int b = Arrays.stream(colors).map(ColorARGB::unpackBlue).sum(); | ||
|
||
int color = ColorARGB.pack(r / colors.length, g / colors.length, b / colors.length, a / colors.length); | ||
Arrays.fill(colors, color); | ||
} | ||
} |
23 changes: 0 additions & 23 deletions
23
.../java/me/flashyreese/mods/sodiumextra/mixin/sodium/biome_blend/MixinChunkRenderCache.java
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.