Untitled

 avatar
unknown
java
a year ago
1.2 kB
3
Indexable
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;
            }
        }
    });
}
Editor is loading...
Leave a Comment