From ecd241ac52eb482b0086472463a064ad00d14b78 Mon Sep 17 00:00:00 2001 From: hyperdefined Date: Mon, 7 Apr 2025 10:56:25 -0400 Subject: [PATCH] fix #99 --- src/main/java/lol/hyper/toolstats/tools/ItemLore.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/lol/hyper/toolstats/tools/ItemLore.java b/src/main/java/lol/hyper/toolstats/tools/ItemLore.java index 42bb77f..ce5576f 100644 --- a/src/main/java/lol/hyper/toolstats/tools/ItemLore.java +++ b/src/main/java/lol/hyper/toolstats/tools/ItemLore.java @@ -940,9 +940,11 @@ public class ItemLore { Map newFlightFormatted = toolStats.numberFormat.formatTime(flightTime + duration); // if the old format is in the config, check to see if the old format is on the elytra if (toolStats.config.getString("messages.flight-time-old") != null) { - String oldFormatFormatted = toolStats.numberFormat.formatDouble((double) flightTime / 1000); - Component oldFormat = toolStats.configTools.formatLore("flight-time-old", "{time}", oldFormatFormatted); - meta.lore(removeLore(meta.lore(), oldFormat)); + if (meta.hasLore()) { + String oldFormatFormatted = toolStats.numberFormat.formatDouble((double) flightTime / 1000); + Component oldFormat = toolStats.configTools.formatLore("flight-time-old", "{time}", oldFormatFormatted); + meta.lore(removeLore(meta.lore(), oldFormat)); + } } Component oldLine = toolStats.configTools.formatLoreMultiplePlaceholders("flight-time", oldFlightFormatted); Component newLine = toolStats.configTools.formatLoreMultiplePlaceholders("flight-time", newFlightFormatted);