From c31624fba3d50c29400fe5be87501e1da5283b30 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sat, 18 Feb 2023 01:23:42 +0800 Subject: [PATCH] Ensure boss bar progress between 0 and 1 --- .../java/net/citizensnpcs/trait/versioned/BossBarTrait.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java b/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java index 61f057b81..a573ddafb 100644 --- a/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java +++ b/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java @@ -147,7 +147,7 @@ public class BossBarTrait extends Trait { if (number >= 1 && number <= 100) { number /= 100.0; } - bar.setProgress(number); + bar.setProgress(Math.min(0, Math.max(1, number))); } } bar.setTitle(title);