Skip to content

Commit

Permalink
Fixed Tank screen addons not rendering the fluid when max int, closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed May 29, 2021
1 parent a4395cb commit 9f1ab9f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public void drawBackgroundLayer(MatrixStack stack, Screen screen, IAssetProvider
Rectangle area = asset.getArea();
if (!tank.getFluid().isEmpty()) {
FluidStack fluidStack = tank.getFluid();
int stored = tank.getFluidAmount();
int capacity = tank.getCapacity();
double stored = tank.getFluidAmount();
double capacity = tank.getCapacity();
int topBottomPadding = asset.getFluidRenderPadding(Direction.UP) + asset.getFluidRenderPadding(Direction.DOWN);
int offset = (stored * (area.height - topBottomPadding) / capacity);
int offset = (int) ((stored / capacity) * (area.height - topBottomPadding));
ResourceLocation flowing = fluidStack.getFluid().getAttributes().getStillTexture(fluidStack);
if (flowing != null) {
Texture texture = screen.getMinecraft().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); //getAtlasSprite
Expand Down

0 comments on commit 9f1ab9f

Please sign in to comment.