Untitled

mail@pastecode.io avatar
unknown
java
2 months ago
1.2 kB
3
Indexable
Never
public class ManaHudOverlay {
    private final ResourceLocation FILLED_MANA = new ResourceLocation(DamkusWeaponry.MOD_ID,
            "textures/thirst/filled_mana.png");
    private final ResourceLocation EMPTY_MANA = new ResourceLocation(DamkusWeaponry.MOD_ID,
            "textures/thirst/empty_mana.png");

    public IGuiOverlay HUD_THIRST = ((gui, poseStack, partialTick, width, height) -> {
        int x = width / 2;
        int y = height;

        RenderSystem.setShader(GameRenderer::getPositionTexShader);
        RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
        RenderSystem.setShaderTexture(0, EMPTY_MANA);
        for (int i = 0; i < 10; i++) {
            // This method has the problem
            GuiGraphics.blit(poseStack,x - 94 + (i * 9), y - 54,0,0,12,12,
                    16,16);
        }

        RenderSystem.setShaderTexture(0, FILLED_MANA);
        for (int i = 0; i < 10; i++) {
            if (ClientManaData.getPlayerMana() > i) {
                // This one as well!
                GuiGraphics.blit(poseStack,x - 94 + (i * 9),y - 54,0,0,12,12,
                        16,16);
            } else {
                break;
            }
        }
    });
}
Leave a Comment