Skip to content

Commit

Permalink
Fix armor uniform
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Dec 26, 2023
1 parent 044c915 commit 6c880cd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void addIrisExclusiveUniforms(UniformHolder uniforms) {
uniforms.uniform1f(UniformUpdateFrequency.PER_FRAME, "thunderStrength", IrisExclusiveUniforms::getThunderStrength);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "currentPlayerHealth", IrisExclusiveUniforms::getCurrentHealth);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "maxPlayerHealth", IrisExclusiveUniforms::getMaxHealth);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "currentPlayerHunger", IrisExclusiveUniforms::getCurrentHunger);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "currentPlayerHunger", IrisExclusiveUniforms::getCurrentHunger);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "maxPlayerHunger", () -> 20);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "currentPlayerArmor", IrisExclusiveUniforms::getCurrentArmor);
uniforms.uniform1f(UniformUpdateFrequency.PER_TICK, "maxPlayerArmor", () -> 50);
Expand Down Expand Up @@ -98,7 +98,7 @@ private static float getCurrentArmor() {
return -1;
}

return (float) Minecraft.getInstance().player.getArmor() / (float) 50.0);
return (float) (Minecraft.getInstance().player.getArmorValue() / 50.0f);
}

private static float getMaxAir() {
Expand All @@ -117,7 +117,7 @@ private static float getMaxHealth() {
return Minecraft.getInstance().player.getMaxHealth();
}



private static boolean isFirstPersonCamera() {
// If camera type is not explicitly third-person, assume it's first-person.
Expand Down

0 comments on commit 6c880cd

Please sign in to comment.