Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
OneEyeMaker opened this issue Jun 30, 2016 · 5 comments
Closed
Assignees

Comments

@OneEyeMaker
Copy link

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.

@Morpheus1101
Copy link

Is this still an issue in the 1.1x versions?

@OneEyeMaker
Copy link
Author

OneEyeMaker commented Mar 9, 2017

@Morpheus1101
Copy link

Morpheus1101 commented Mar 9, 2017

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

@OneEyeMaker
Copy link
Author

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

@Morpheus1101
Copy link

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

@SpitefulFox SpitefulFox self-assigned this Nov 10, 2017
glowredman added a commit to GTNewHorizons/Avaritia that referenced this issue Feb 7, 2022
Fixes SpitefulFox#99

https: //github.com/SpitefulFox/Avaritia/commit/6c6503bc23de22d76694763e1b21e38d217f56c3
Co-Authored-By: SpitefulFox <6055143+SpitefulFox@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants