Skip to content

Commit

Permalink
Fix biome tinting
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna0x01 committed Dec 29, 2024
1 parent 7e505aa commit e9d2e9f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.caffeinemc.mods.sodium.client.model.color;

import dev.vexor.radium.compat.mojang.minecraft.IBlockColor;
import net.caffeinemc.mods.sodium.api.util.ColorARGB;
import net.caffeinemc.mods.sodium.client.model.quad.ModelQuadView;
import net.caffeinemc.mods.sodium.client.model.quad.blender.BlendedColorProvider;
import net.caffeinemc.mods.sodium.client.world.LevelSlice;
Expand All @@ -21,14 +22,14 @@ public static ColorProvider<BlockState> adapt(IBlockColor color) {
public static class GrassColorProvider extends BlendedColorProvider<BlockState> {
@Override
protected int getColor(LevelSlice slice, BlockState state, BlockPos pos) {
return slice.getColor(BiomeColorSource.GRASS, pos.getX(), pos.getY(), pos.getZ());
return ColorARGB.toABGR(slice.getColor(BiomeColorSource.GRASS, pos.getX(), pos.getY(), pos.getZ()));
}
}

public static class FoliageColorProvider extends BlendedColorProvider<BlockState> {
@Override
protected int getColor(LevelSlice slice, BlockState state, BlockPos pos) {
return slice.getColor(BiomeColorSource.FOLIAGE, pos.getX(), pos.getY(), pos.getZ());
return ColorARGB.toABGR(slice.getColor(BiomeColorSource.FOLIAGE, pos.getX(), pos.getY(), pos.getZ()));
}
}

Expand All @@ -41,7 +42,7 @@ private VanillaAdapter(IBlockColor color) {

@Override
public void getColors(LevelSlice slice, BlockPos pos, BlockState state, ModelQuadView quad, int[] output) {
Arrays.fill(output, this.color.colorMultiplier(state, slice, pos, quad.getTintIndex()));
Arrays.fill(output, ColorARGB.toABGR(this.color.colorMultiplier(state, slice, pos, quad.getTintIndex())));
}
}
}

0 comments on commit e9d2e9f

Please sign in to comment.