Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LP Hud fix #59

Merged
merged 5 commits into from
Oct 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,32 +102,30 @@ public static boolean onTickInGame(Minecraft mc) {
return true;
}

private static void renderLPHUD(Minecraft mc, int lpAmount, int maxAmount) {
GL11.glPushMatrix();
int xSize = 32;
int ySize = 32;

int amount = Math.max((int) (256 * ((double) (maxAmount - lpAmount) / maxAmount)), 0);

int x = (lpBarX - xSize / 2) * 8;
int y = (lpBarY - ySize / 2) * 8;

ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png");
GL11.glColor4f(1, 0, 0, 1.0F);
mc.getTextureManager().bindTexture(test2);

GL11.glScalef(1f / 8f, 1f / 8f, 1f / 8f);

drawTexturedModalRect(x, y + amount, 0, amount, 256, 256 - amount);

ResourceLocation test = new ResourceLocation("alchemicalwizardry", "textures/gui/lpVial.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(test);

drawTexturedModalRect(x, y, 0, 0, 256, 256);

GL11.glPopMatrix();
}
private static void renderLPHUD(Minecraft mc, int lpAmount, int maxAmount) {
GL11.glPushMatrix();
int xSize = 32;
int ySize = 32;
int amount = Math.max((int) (256 * ((double) (maxAmount - lpAmount) / maxAmount)), 0);
int x = (lpBarX - xSize / 2) * 8;
int y = (lpBarY - ySize / 2) * 8;
ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png");
GL11.glColor4f(1, 0, 0, 1.0F);
GL11.glEnable(GL11.GL_BLEND);
mc.renderEngine.bindTexture(test2);
GL11.glScalef(1f / 8f, 1f / 8f, 1f / 8f);
GL11.glPushMatrix();
drawTexturedModalRect(x, y + amount, 0, amount, 256, 256 - amount);
GL11.glPopMatrix();
ResourceLocation test = new ResourceLocation("alchemicalwizardry", "textures/gui/lpVial.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(test);
GL11.glPushMatrix();
drawTexturedModalRect(x, y, 0, 0, 256, 256);
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}

private static void renderHPHUD(Minecraft mc, float hpAmount, float maxAmount) {
GL11.glPushMatrix();
Expand Down
Loading