Skip to content

Commit

Permalink
Fix for #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrails committed Mar 18, 2024
1 parent f382aa9 commit 5f5f543
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import org.lwjgl.opengl.GL11;
import terrails.colorfulhearts.LoaderExpectPlatform;
import terrails.colorfulhearts.heart.CHeartType;
import terrails.colorfulhearts.heart.Heart;

Expand All @@ -32,6 +33,8 @@ public void drawHealthOverlay(GuiGraphics guiGraphics, int x, int y, int absorbi
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, alpha);
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

boolean hardcore = LoaderExpectPlatform.forcedHardcoreHearts() || (client.level.getLevelData().isHardcore());

for (int index = 0; index < this.hearts.length; index++) {
Heart heart = this.hearts[index];
int xPos = x + (index % 10) * 8;
Expand All @@ -44,7 +47,7 @@ public void drawHealthOverlay(GuiGraphics guiGraphics, int x, int y, int absorbi

if (heart == null) continue;

heart.draw(guiGraphics, xPos, yPos, false, false, false);
heart.draw(guiGraphics, xPos, yPos, hardcore, false, false);
}
RenderSystem.disableBlend();
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
Expand Down

0 comments on commit 5f5f543

Please sign in to comment.