diff --git a/src/main/java/com/caedis/duradisplay/overlay/OverlayDurabilityLike.java b/src/main/java/com/caedis/duradisplay/overlay/OverlayDurabilityLike.java index 764398d..9845fa9 100644 --- a/src/main/java/com/caedis/duradisplay/overlay/OverlayDurabilityLike.java +++ b/src/main/java/com/caedis/duradisplay/overlay/OverlayDurabilityLike.java @@ -62,9 +62,10 @@ protected final void addHandler(@NotNull String className, if (info != null) { return info; } + return DurabilityLikeInfo.empty; } } - return new DurabilityLikeInfo(0, 0); + return DurabilityLikeInfo.empty; } protected int getColor(DurabilityLikeInfo info) { diff --git a/src/main/java/com/caedis/duradisplay/utils/DurabilityLikeInfo.java b/src/main/java/com/caedis/duradisplay/utils/DurabilityLikeInfo.java index d746c68..d9c5424 100644 --- a/src/main/java/com/caedis/duradisplay/utils/DurabilityLikeInfo.java +++ b/src/main/java/com/caedis/duradisplay/utils/DurabilityLikeInfo.java @@ -12,6 +12,8 @@ public DurabilityLikeInfo(double current, double max) { this.max = max; } + public static final DurabilityLikeInfo empty = new DurabilityLikeInfo(0, 0); + public boolean isFull() { return current != 0 && current == max; }