float x = START_X;
float dx = 0.06f * SCALE;
// Health bar
final RenderPartPacksComponent heartsRect = hearts.add(RenderPartPacksComponent.class);
final RenderPartPack hearts_pack = new RenderPartPack(VanillaRenderMaterials.ICONS_MATERIAL);
float y = VanillaConfiguration.HARDCORE_MODE.getBoolean() ? 45f / 256f : 0;
for (int i = 0; i < 10; i++) {
final RenderPart heart = new RenderPart();
heart.setColor(Color.WHITE);
heart.setSprite(new org.spout.api.math.Rectangle(x + 0.005f, -0.77f, 0.065f * SCALE, 0.065f));
heart.setSource(new org.spout.api.math.Rectangle(53f / 256f, y, 9f / 256f, 9f / 256f));
hearts_pack.add(heart);
x += dx;
}
x = START_X;
for (int i = 0; i < 10; i++) {
final RenderPart heartBg = new RenderPart();
heartBg.setColor(Color.WHITE);
heartBg.setSprite(new org.spout.api.math.Rectangle(x, -0.77f, 0.065f * SCALE, 0.065f));
heartBg.setSource(new org.spout.api.math.Rectangle(16f / 256f, y, 9f / 256f, 9f / 256f));
hearts_pack.add(heartBg);
x += dx;
}
heartsRect.add(hearts_pack);