Avaritia

Avaritia

10M Downloads

[1.7.10][Feature request] Add NBT support for Extreme Crafting table.

OneEyeMaker opened this issue ยท 5 comments

commented

Hello. The title says it all. Now Extreme Crafting table (Dire Crafting table) doesn't supports recipes with NBT at all, because all recipe handlers (ExtremeShapedRecipe, ExtremeShapedOreRecipe, ...) just check equality of items and its' damages (and ignore NBT) instead of checking equality of ItemStacks.
I guess, you should use ItemStack.areItemStacksEqual() instead of this and this.
Please, change this mechanic to enable more complex MT recipes for Extreme Crafting table.

commented

Is this still an issue in the 1.1x versions?

commented

Have you used the 1.10 & 1.11 versions to see if this is still a thing? Im reasonably sure that the tables support NBT...

https://github.com/Morpheus1101/Avaritia/blob/1.11.2/src/main/java/fox/spiteful/avaritia/crafting/ExtremeShapedOreRecipe.java#L201

commented

I also don't see code for handling NBT there.
The essence of this issue is that, if I add recipe with tweaker item, that requires NBT (mod:stack.withTag({...}); onlyWithTag doesn't work with Extreme Crafting table), now I can craft this recipe with item without this NBT.

You should change this like so:

if (target instanceof ItemStack)
{
    ItemStack targetStack = (ItemStack) target;
    if (!OreDictionary.itemMatches(targetStack, slot, false))
    {
        return false;
    }
    if (targetStack.hasTagCompound())
    {
        NBTTagCompound tagCompound = targetStack.getTagCompound();
        if (!slot.hasTagCompound)
        {
            return false;
        }
        NBTTagCompound slotTagCompound = slot.getTagCompound();
        // I forget, how to compare NBT...
        if (!slotTagCompound.equals(tagCompound))
        {
                return false;
        }
    }
}

And the same thing here

commented

Brandon is fixing this and it shall be in the updated vers for 1.1x soon'ish