Woot

Woot

24M Downloads

Some modded enchanting books do not work in the recipes.

KitKat31337 opened this issue ยท 12 comments

commented

Specifically, I think this has to do with enchanting plus.

commented

I'll try putting that mod in my dev environment and see if I can work out what is going on.

commented

If you like, I can send you my curse manifest and even bring you on the server for testing.

commented

The curse manifest would probably help, as it will make it easier to replicate and test the fix.

commented

Message me on discord if you want to take a peek at the server. KitKat31337#8080

commented

From what I can see, it wouldn't just be a different recipe, I would have to add a custom recipe handler that didn't just match NBT data, but allowed almost a fuzzy-match on the NBT.

After some discussion on Discord, I'm going to try the custom recipe handler and make it work for vanilla and E+. So hopefully in the next version this will be fixed.

commented

So I've tried running your Curse project .... and run out of memory.
What memory line do you use to run your modpack?

commented

Ignore that last comment, I just added the Enchanting Plus mod to my test mod instance and I can replicate the issue. Nothing seems different between the vanilla and E+ books in terms of metadata or NBT.
However the E+ books are working for a Blood Magic recipe, which I also have installed.

I'll dig a bit further and see if I'm added in the recipe in such a way that anything that is not a direct copy of a vanilla enchanted book will not work.

commented

Found the different.
Vanilla: {StoredEnchantments:[0:{lvl:1s,id:48s}]
E+ {StoredEnchantments:[0:{lvl:1,id:48s}]

That lvl:1s to lvl:1 means that the recipe does not match.

I have a customer recipe handler for the recipes that involve specific types and levels of books and I think the item stack equality check fails for the above case. I'll try and see if there is any other way I can do this, to ensure that all books with a specific enchant will work.

commented

After some more digging, I'm not alone in this.
The books from E+ are, as shown above, slightly different and may not work in other mods that require a specific enchanted book. As a general enchanted book in a recipe, they are fine. The problem occurs when a recipe wants a "Looting I" or a "Power V" book.

The Woot recipe works fine with an Ender IO enchanter based book, just not an E+ plus.

I'll keep looking, but I'm not seeing an easy fix in Woot for this.

To show the difference, this is the tag addition from Vanilla where two shorts are used.

       NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setShort("id", short)Enchantment.getEnchantmentID(enchantment.enchantmentobj));
        nbttagcompound1.setShort("lvl", (short)enchantment.enchantmentLevel);
        nbttaglist.appendTag(nbttagcompound1);

This is the E+ tag addtition where one short one integer is used.

        final NBTTagCompound nbttagcompound = new NBTTagCompound();
        nbttagcompound.setShort("id", (short) Enchantment.getEnchantmentID(data.enchantmentobj));
        nbttagcompound.setInteger("lvl", data.enchantmentLevel);
        nbttaglist.appendTag(nbttagcompound);

In most uses of the enchanted book, this doesn't matter. It is only when the book is used in a recipe with a specific enchant that is causes issues with NBT equality ........ as far as I understand.

commented

Yeah, Based on what you found, the only fix I could see is checking if E+ is installed and loading different recipes. Or additional ones.

commented

Oh, and yeah, that pack crashes with less that 5GB Ram for some reason. Evne though once launched sits around 2-3 used for me.