Skip to content

Commit

Permalink
Merge final changes to vertex alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Aug 16, 2024
1 parent cd18e7f commit 5e3c95a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ public class DefaultFluidRenderer {
private final float[] brightness = new float[4];

private final ChunkVertexEncoder.Vertex[] vertices = ChunkVertexEncoder.Vertex.uninitializedQuad();
private final ColorProviderRegistry colorProviderRegistry;

public DefaultFluidRenderer(ColorProviderRegistry colorProviderRegistry, LightPipelineProvider lighters) {
public DefaultFluidRenderer(LightPipelineProvider lighters) {
this.quad.setLightFace(Direction.UP);

this.lighters = lighters;
this.colorProviderRegistry = colorProviderRegistry;
}

private boolean isFluidOccluded(BlockAndTintGetter world, int x, int y, int z, Direction dir, BlockState blockState, Fluid fluid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public FabricFluidAdapter(FluidRenderHandler handler) {

@Override
public void getColors(LevelSlice slice, BlockPos pos, BlockPos.MutableBlockPos scratchPos, FluidState state, ModelQuadView quad, int[] output) {
Arrays.fill(output, this.handler.getFluidColor(slice, pos, state));
Arrays.fill(output, 0xFF000000 |this.handler.getFluidColor(slice, pos, state));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class FluidRendererImpl extends FluidRenderer {

public FluidRendererImpl(ColorProviderRegistry colorProviderRegistry, LightPipelineProvider lighters) {
this.colorProviderRegistry = colorProviderRegistry;
defaultRenderer = new DefaultFluidRenderer(colorProviderRegistry, lighters);
defaultRenderer = new DefaultFluidRenderer(lighters);
defaultContext = new DefaultRenderContext();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class FluidRendererImpl extends FluidRenderer {

public FluidRendererImpl(ColorProviderRegistry colorProviderRegistry, LightPipelineProvider lighters) {
this.colorProviderRegistry = colorProviderRegistry;
defaultRenderer = new DefaultFluidRenderer(colorProviderRegistry, lighters);
defaultRenderer = new DefaultFluidRenderer(lighters);
}

public void render(LevelSlice level, BlockState blockState, FluidState fluidState, BlockPos blockPos, BlockPos offset, TranslucentGeometryCollector collector, ChunkBuildBuffers buffers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public ForgeFluidAdapter(IClientFluidTypeExtensions handler) {

@Override
public void getColors(LevelSlice slice, BlockPos pos, BlockPos.MutableBlockPos scratchPos, FluidState state, ModelQuadView quad, int[] output) {
Arrays.fill(output, ColorARGB.withAlpha(this.handler.getTintColor(state, slice, pos), 255));
Arrays.fill(output,this.handler.getTintColor(state, slice, pos));
}
}
}

0 comments on commit 5e3c95a

Please sign in to comment.