pajicadvance / enchantmentdisabler

Disable enchantments you don't like, and nerf enchanting in multiple ways with an extensive configuration. Supports modded enchantments.
MIT License
4 stars 0 forks source link

[BUG] Opening villager trade menu crashes when all enchantments are disabled #1

Closed EpicGamer42069Fortnite closed 10 months ago

EpicGamer42069Fortnite commented 1 year ago

Mod version: 0.1.3 Minecraft version: 1.20.1

Steps to recreate:

  1. Disable ALL enchants in config.
  2. Set up a new librarian villager.
  3. Open trading menu and crash.

It no longer crashes if I enable at least one enchantment in the config.

image

And the error inside the log file:

[19:21:34] [Render thread/ERROR]: Unreported exception thrown! java.lang.IllegalArgumentException: Bound must be positive at net.minecraft.class_6566.method_43048(class_6566.java:22) ~[client-intermediary.jar:?] at net.minecraft.class_3853$class_1648.method_7246(class_3853.java:842) ~[client-intermediary.jar:?] at net.minecraft.class_3988.method_19170(class_3988.java:251) ~[client-intermediary.jar:?] at net.minecraft.class_1646.method_7237(class_1646.java:898) ~[client-intermediary.jar:?] at net.minecraft.class_3988.method_8264(class_3988.java:115) ~[client-intermediary.jar:?] at net.minecraft.class_1646.method_5992(class_1646.java:339) ~[client-intermediary.jar:?] at net.minecraft.class_1308.method_5688(class_1308.java:1155) ~[client-intermediary.jar:?] at net.minecraft.class_1657.method_7287(class_1657.java:1077) ~[client-intermediary.jar:?] at net.minecraft.class_636.method_2905(class_636.java:423) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1583(class_310.java:1787) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1508(class_310.java:2052) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1574(class_310.java:1883) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1523(class_310.java:1181) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1514(class_310.java:802) ~[client-intermediary.jar:?] at net.minecraft.client.main.Main.main(Main.java:250) ~[fabric-loader-0.14.22-1.20.1.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.22.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.22.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.22.jar:?]

pajicadvance commented 1 year ago

Thanks for the report. The mod wasn't made with disabling every single enchantment from the game in mind, but I do agree that there should be a fallback for this specific situation. I'll see if I can replace the enchantment book librarian trade with something else entirely when all enchantments are disabled in a future update.

EpicGamer42069Fortnite commented 1 year ago

I haven't tested it with blacksmith villagers yet but I would suggest looking into them as well.

EDIT: Just tested it lol. It seems that they give trades with no enchants, so I think they should be fine.

pajicadvance commented 10 months ago

Fixed in 0.2.1 for 1.20.4 and 0.1.4 for all game versions below. Now you get a 1 emerald for 1 regular book trade instead of a game crash.

guskikalola commented 5 months ago

This is not fixed, it still crashes while trading with

java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because "me.pajic.enchantmentdisabler.util.EnchantmentUtil.ENCHANTMENT_BLACKLIST" is null

Mod version: 1.4.0

pajicadvance commented 5 months ago

Which Minecraft version are you using? I may have missed updating a certain version.

guskikalola commented 5 months ago

Sorry, forgot to add that info, Minecraft 1.20.1

You need to level up the villager until it trades armors or weapons with enchantments

pajicadvance commented 4 months ago

Sorry, but I can't reproduce this issue on the latest version of the mod for 1.20.1. The weapons and armor which are supposed to be enchanted just become unenchanted in the trade, as expected. Make sure you're on the latest version of the mod.