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 bf6badf commit 274b785
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Component> children = c.children();
if (children.size() < 2) {
Expand All @@ -68,7 +73,6 @@ public static void setCharge(ItemMeta meta, float charge, float capacity) {
}
} else {
if (c.content().isEmpty()) {

List<Component> children = c.children();
if (children.size() < 3) {
continue;
Expand All @@ -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;
}
}
}
}
Expand Down

0 comments on commit 274b785

Please sign in to comment.