Fixed issue with parsing infinite chunk loaders

This commit is contained in:
OmerBenGera 2020-10-29 13:29:51 +02:00
parent b0e3890cba
commit 712f1373c0
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -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);
}
}