[1.7.10][Feature request] Add NBT support for Extreme Crafting table.
OneEyeMaker opened this issue ยท 5 comments
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.
I found this issue in 1.11 (1.7.10).
And there's no code, which checks NBT:
https://github.com/SpitefulFox/Avaritia/blob/1.7.10/src/main/java/fox/spiteful/avaritia/crafting/ExtremeShapedOreRecipe.java#L201
https://github.com/SpitefulFox/Avaritia/blob/master/src/main/java/fox/spiteful/avaritia/crafting/ExtremeShapedOreRecipe.java#L202
(Shapeless recipe handler also hasn't this code).
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...
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