diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-09-23 04:53:29 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-22 20:53:29 +0200 |
| commit | 2d9bf47ca3a61fee56d3a52f56ee0daca626a9c8 (patch) | |
| tree | 3335a6524c1c294e95f33628ab76ee4fba9bf366 /src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java | |
| parent | e5f1c29a9266fde6f1a558639bedc6437dffe7cb (diff) | |
| download | notenoughupdates-2d9bf47ca3a61fee56d3a52f56ee0daca626a9c8.tar.gz notenoughupdates-2d9bf47ca3a61fee56d3a52f56ee0daca626a9c8.tar.bz2 notenoughupdates-2d9bf47ca3a61fee56d3a52f56ee0daca626a9c8.zip | |
Added price display to books in hex (#292)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java index 748694cb..6f190ada 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -377,10 +377,12 @@ public class GuiCustomEnchant extends Gui { if (ea != null) { NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); if (enchantments != null) { - String enchId = Utils.cleanColour(book.getDisplayName()).toLowerCase().replace(" ", "_").replace( - "-", - "_" - ); + String enchId = Utils + .cleanColour(book.getDisplayName()) + .toLowerCase() + .replace(" ", "_") + .replace("-", "_") + .replaceAll("[^a-z_]", ""); String name = Utils.cleanColour(book.getDisplayName()); int enchLevel = -1; if (name.equalsIgnoreCase("Bane of Arthropods")) { @@ -455,7 +457,8 @@ public class GuiCustomEnchant extends Gui { .cleanColour(book.getDisplayName()) .toLowerCase() .replace(" ", "_") - .replace("-", "_"); + .replace("-", "_") + .replaceAll("[^a-z_]", ""); if (enchId.equalsIgnoreCase("_")) continue; enchId = ItemUtils.fixEnchantId(enchId, true); String name = Utils.cleanColour(book.getDisplayName()); |
