#750 Make sure recipes with NBT do not match items with no NBT

This commit is contained in:
mezz committed 2015-09-24 00:49:26 -07:00
1 parent f6e3eb9335
commit 19a802fd68
2 files changed
+22 -2

No files matched your search

@@ -77,7 +77,17 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe {
@Override
public boolean matches(InventoryCrafting inventoryCrafting, World world) {
return matches((IInventory) inventoryCrafting, world);
if (!matches((IInventory) inventoryCrafting, world)) {
return false;
}
if (preserveNBT) {
if (RecipeUtil.getCraftingNbt(inventoryCrafting) == null) {
return false;
}
}
return true;
}
public boolean matches(IInventory inventoryCrafting, World world) {
@@ -73,7 +73,17 @@ public class ShapelessRecipeCustom implements IRecipe {
}
}
return arraylist.isEmpty();
if (!arraylist.isEmpty()) {
return false;
}
if (preservesNbt) {
if (RecipeUtil.getCraftingNbt(inventoryCrafting) == null) {
return false;
}
}
return true;
}
@Override