Skip to content

Commit 94ff8f2

Browse files
committed
go back to text comparison
this broke something with another plugin
1 parent f9fa15d commit 94ff8f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import lol.hyper.toolstats.ToolStats;
2121
import net.kyori.adventure.text.Component;
22+
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
2223
import org.bukkit.inventory.meta.ItemMeta;
2324
import org.bukkit.persistence.PersistentDataContainer;
2425
import org.bukkit.persistence.PersistentDataType;
@@ -49,10 +50,10 @@ public List<Component> updateItemLore(ItemMeta itemMeta, Component oldLine, Comp
4950
// keep track of line index
5051
// this doesn't mess the lore of existing items
5152
for (int x = 0; x < itemLore.size(); x++) {
52-
Component line = itemLore.get(x);
53+
String line = PlainTextComponentSerializer.plainText().serialize(itemLore.get(x));
5354
// find the old line to update, keeping index
5455
// this means we update this line only!
55-
if (line.equals(oldLine)) {
56+
if (line.equals(PlainTextComponentSerializer.plainText().serialize(oldLine))) {
5657
itemLore.set(x, newLine);
5758
return itemLore;
5859
}

0 commit comments

Comments
 (0)