diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChargeUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChargeUtils.java index 710cbcd34e..1e47bfc51b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChargeUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChargeUtils.java @@ -54,6 +54,11 @@ public static void setCharge(ItemMeta meta, float charge, float capacity) { for (int i = 0; i < lore.size(); i++) { Component line = lore.get(i); if (line instanceof TextComponent c) { + if (REGEX.matcher(c.content()).matches()) { + lore.set(i, newLine); + meta.lore(lore); + return; + } if (c.content().equals("\u21E8")) { List children = c.children(); if (children.size() < 2) { @@ -68,7 +73,6 @@ public static void setCharge(ItemMeta meta, float charge, float capacity) { } } else { if (c.content().isEmpty()) { - List children = c.children(); if (children.size() < 3) { continue; @@ -84,12 +88,6 @@ public static void setCharge(ItemMeta meta, float charge, float capacity) { return; } } - } else { - if (REGEX.matcher(c.content()).matches()) { - lore.set(i, newLine); - meta.lore(lore); - return; - } } } }