fixed capacity rendering for creative storage (#2964)

This commit is contained in:
Darkere
2021-05-12 15:42:50 +02:00
committed by GitHub
parent b2e829ed42
commit d58ed7a234

View File

@@ -86,7 +86,7 @@ public class StorageScreen<T extends Container> extends BaseScreen<T> {
blit(matrixStack, x, y, 0, 0, xSize, ySize);
int barHeightNew = (int) ((float) storedSupplier.get() / (float) capacitySupplier.get() * (float) BAR_HEIGHT);
int barHeightNew = capacitySupplier.get() < 0 ? 0 : (int) ((float) storedSupplier.get() / (float) capacitySupplier.get() * (float) BAR_HEIGHT);
blit(matrixStack, x + BAR_X, y + BAR_Y + BAR_HEIGHT - barHeightNew, 179, BAR_HEIGHT - barHeightNew, BAR_WIDTH, barHeightNew);
}