From 54f97e2d16f70e6155c1f9019078b0d0026c684c Mon Sep 17 00:00:00 2001 From: Archy-X <63976867+Archy-X@users.noreply.github.com> Date: Fri, 28 Jun 2024 23:04:35 -0700 Subject: [PATCH] Fix hp keep_full_on_increase not working sometimes --- .../java/dev/aurelium/auraskills/bukkit/trait/HpTrait.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/trait/HpTrait.java b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/trait/HpTrait.java index c98fb4eab..45ee2cd27 100644 --- a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/trait/HpTrait.java +++ b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/trait/HpTrait.java @@ -163,7 +163,8 @@ private void setHealth(Player player, User user) { } if (trait.optionBoolean("keep_full_on_increase", false) && attribute.getValue() > originalMaxHealth) { // Heals player to full health if had full health before modifier - if (player.getHealth() >= originalMaxHealth) { + final double THRESHOLD = 0.01; + if (player.getHealth() >= originalMaxHealth - THRESHOLD) { player.setHealth(attribute.getValue()); } }