Bump up to 1.19.1

This commit is contained in:
2022-07-31 20:33:10 +02:00
parent 71ff9c02a9
commit fdadb1b1f1
2 changed files with 9 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.FastColor;
import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.templates.FluidTank;
@@ -52,14 +53,15 @@ public class FluidStackWidget extends AbstractWidget {
FluidTank fluidTank = getFluid.get();
if (!fluidTank.isEmpty()) {
FluidStack fluidStack = fluidTank.getFluid();
ResourceLocation still = fluidStack.getFluid().getAttributes().getStillTexture(fluidStack);
IClientFluidTypeExtensions props = IClientFluidTypeExtensions.of(fluidStack.getFluid());
ResourceLocation still = props.getStillTexture(fluidStack);
if (still != null) {
AbstractTexture texture = minecraft.getTextureManager().getTexture(TextureAtlas.LOCATION_BLOCKS);
if (texture instanceof TextureAtlas atlas) {
TextureAtlasSprite sprite = atlas.getSprite(still);
RenderSystem.setShaderTexture(0, TextureAtlas.LOCATION_BLOCKS);
int color = fluidStack.getFluid().getAttributes().getColor();
int color = props.getTintColor();
RenderSystem.setShaderColor(
FastColor.ARGB32.red(color) / 255.0F,
FastColor.ARGB32.green(color) / 255.0F,