mirror of
https://github.com/songoda/EpicEnchants.git
synced 2025-01-03 15:08:19 +01:00
Fixed issue where black scroll wouldnt remove enchants.
This commit is contained in:
parent
094151904f
commit
25b977b37f
@ -1,5 +1,6 @@
|
|||||||
package com.songoda.epicenchants.utils;
|
package com.songoda.epicenchants.utils;
|
||||||
|
|
||||||
|
import com.songoda.core.utils.TextUtils;
|
||||||
import com.songoda.epicenchants.EpicEnchants;
|
import com.songoda.epicenchants.EpicEnchants;
|
||||||
import com.songoda.epicenchants.enums.EnchantResult;
|
import com.songoda.epicenchants.enums.EnchantResult;
|
||||||
import com.songoda.epicenchants.enums.EventType;
|
import com.songoda.epicenchants.enums.EventType;
|
||||||
@ -132,9 +133,12 @@ public class EnchantUtils {
|
|||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String format = enchant.getFormat().replace("{level}", "").trim();
|
||||||
|
String text = format.isEmpty() ? enchant.getColoredIdentifier(false) : format;
|
||||||
|
|
||||||
nbtItem.getCompound("enchants").removeKey(enchant.getIdentifier());
|
nbtItem.getCompound("enchants").removeKey(enchant.getIdentifier());
|
||||||
ItemBuilder output = new ItemBuilder(nbtItem.getItem());
|
ItemBuilder output = new ItemBuilder(nbtItem.getItem());
|
||||||
output.removeLore(enchant.getFormat().replace("{level}", "").trim());
|
output.removeLore(TextUtils.formatText(text));
|
||||||
return output.build();
|
return output.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user