Skip to content

Commit

Permalink
yay I blit right!
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Mar 30, 2024
1 parent a252347 commit 1bdbfac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ public void render(ForgeGui gui, GuiGraphics graphics, float partialTick, int sc
gui.setupOverlayRenderState(true, false);
int minX = 32;
int minY = screenHeight - 32;
graphics.blit(GUI_TEXTURE, minX, minY, 0, 0, 64, 32, 64, 32);
graphics.blit(GUI_TEXTURE, minX, minY, 0, 0, 64, 16, 64, 32);

long oxygenAmount = SpaceSuitArmorItem.oxygenAmount(gui.getMinecraft().player);
long maxOxygen = SpaceSuitArmorItem.oxygenMax(gui.getMinecraft().player);
if (maxOxygen == 0) {
return;
}
graphics.blit(GUI_TEXTURE, minX, minY, 0, 0.5f, (int) (oxygenAmount * 64.0 / maxOxygen), 32, 64, 32);
int width = (int) (oxygenAmount * 64.0 / maxOxygen);
graphics.blit(GUI_TEXTURE, minX, minY, 0, 16, width, 16, 64, 32);
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1bdbfac

Please sign in to comment.