Skip to content

Commit 39d8a42

Browse files
committed
clean this up a bit
1 parent 91090dd commit 39d8a42

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/lol/hyper/toolstats/tools/ItemLore.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,18 @@ public List<String> addItemLore(ItemMeta itemMeta, String placeholder, String pl
5959

6060
if (itemMeta.hasLore()) {
6161
newLore = itemMeta.getLore();
62-
boolean hasLore = false;
6362
// keep track of line index
6463
// this doesn't mess the lore of existing items
6564
for (int x = 0; x < newLore.size(); x++) {
6665
// check to see if the line matches the config value
6766
// this means we update this line only!
6867
if (newLore.get(x).contains(configLore)) {
69-
hasLore = true;
7068
newLore.set(x, newLine);
71-
break;
69+
return newLore;
7270
}
7371
}
74-
// if the item has lore but doesn't have our line, add it
75-
if (!hasLore) {
76-
newLore.add(newLine);
77-
}
72+
// if the item has lore, but we didn't find the line
73+
newLore.add(newLine);
7874
} else {
7975
// if the item has no lore, create a new list and add the line
8076
newLore = new ArrayList<>();
@@ -146,8 +142,9 @@ public List<String> addNewOwner(ItemMeta itemMeta, String playerName, String for
146142

147143
/**
148144
* Add origin to already existing items.
145+
*
149146
* @param itemStack The item to add origin to.
150-
* @param origin The origin type.
147+
* @param origin The origin type.
151148
*/
152149
public void addOriginTag(ItemStack itemStack, int origin) {
153150
ItemMeta itemMeta = itemStack.getItemMeta();

0 commit comments

Comments
 (0)