Skip to content

Commit

Permalink
Update ChargeUtils.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Nov 16, 2024
1 parent 274b785 commit 47d7d1f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class ChargeUtils {


private static final Pattern REGEX_NEW =
Pattern.compile(NUMBER_PREFIX + "/" + NUMBER_PREFIX + " J");
Pattern.compile(NUMBER_PREFIX + " / " + NUMBER_PREFIX + " J");

private ChargeUtils() {
}
Expand All @@ -54,11 +54,6 @@ 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<Component> children = c.children();
if (children.size() < 2) {
Expand Down Expand Up @@ -88,6 +83,12 @@ 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;
}
}
}
}
Expand Down

0 comments on commit 47d7d1f

Please sign in to comment.