Compare to correct tag in lore processing

This commit is contained in:
KennyTV 2020-08-10 18:03:46 +02:00
parent 6289e9317d
commit 11bb1349e9
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -52,17 +52,17 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
if (lore != null) {
ListTag original = null;
boolean changed = false;
for (Tag loreEntry : lore) {
if (!(loreEntry instanceof StringTag)) continue;
for (Tag loreEntryTag : lore) {
if (!(loreEntryTag instanceof StringTag)) continue;
StringTag stringTag = (StringTag) loreEntry;
String newValue = translatableRewriter.processText(stringTag.getValue()).toString();
if (!changed && !newValue.equals(name.getValue())) {
StringTag loreEntry = (StringTag) loreEntryTag;
String newValue = translatableRewriter.processText(loreEntry.getValue()).toString();
if (!changed && !newValue.equals(loreEntry.getValue())) {
changed = true;
original = lore.clone();
}
stringTag.setValue(newValue);
loreEntry.setValue(newValue);
}
if (changed) {