mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2024-11-12 10:23:59 +01:00
Fixed issue with parsing infinite chunk loaders
This commit is contained in:
parent
b0e3890cba
commit
712f1373c0
@ -55,7 +55,7 @@ public final class WLoaderData implements LoaderData {
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
|
||||
if(itemMeta != null){
|
||||
String formattedTime = TimeUtils.formatTime(timeLeft);
|
||||
String formattedTime = isInfinite() ? "" : TimeUtils.formatTime(timeLeft);
|
||||
|
||||
if(itemMeta.hasDisplayName()) {
|
||||
itemMeta.setDisplayName(itemMeta.getDisplayName().replace("{}", formattedTime));
|
||||
|
@ -111,7 +111,7 @@ public final class TimeUtils {
|
||||
.append((time == 1 ? Locale.TIME_PLACEHOLDER_SECOND : Locale.TIME_PLACEHOLDER_SECONDS).getMessage());
|
||||
}
|
||||
|
||||
return stringBuilder.substring(2);
|
||||
return stringBuilder.length() == 0 ? "" : stringBuilder.substring(2);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user