Fixed nbt and meta recipe output issue

meta for recipes that had no defined meta was getting set to max meta
value. This catches on that and sets its to zero. Later after i work out
other bugs i'll flip this to being random to allow for more complex
salvaging.
This commit is contained in:
DarkGuardsman 2013-09-17 16:14:00 -04:00
parent 509a5c661b
commit 03ca8bde35
2 changed files with 9 additions and 4 deletions

View file

@ -6,6 +6,7 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import dark.core.prefab.helpers.AutoCraftingManager;
import dark.core.prefab.helpers.Pair;
@ -152,11 +153,15 @@ public class ProcessorRecipes
{
if (recipeList[i] != null && random.nextFloat() >= chance)
{
if (recipeList[i].getItemDamage() == 32767)
int meta = recipeList[i].getItemDamage();
NBTTagCompound tag = recipeList[i].getTagCompound();
if (recipeList[i].itemID < Block.blocksList.length && Block.blocksList[recipeList[i].itemID] != null && recipeList[i].getItemDamage() > 16)
{
recipeList[i] = new ItemStack(recipeList[i].itemID, recipeList[i].stackSize, recipeList[i].getItemDamage());
meta = 0;
}
reList[i] = recipeList[i];
reList[i] = new ItemStack(recipeList[i].itemID, recipeList[i].stackSize, meta);
reList[i].setTagCompound(tag);
}
}
}

View file

@ -351,7 +351,7 @@ public class AutoCraftingManager
if (checkStack != null)
{
this.printDebug("ResourceChecker", " -----Item in slot0" + i + " = " + checkStack.toString());
if (this.areStacksEqual(recipeItem, checkStack))
if (AutoCraftingManager.areStacksEqual(recipeItem, checkStack))
{
this.printDebug("ResourceChecker", "Found matching item " + checkStack.toString());
return i;