Pattern slots now report the output qty as well as the item type, at all times ( not just when shift is held )

This commit is contained in:
AlgorithmX2
2014-04-23 00:30:29 -05:00
parent 94951b4209
commit 589e2d60d2
3 changed files with 41 additions and 45 deletions
+29
View File
@@ -74,6 +74,35 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
}
}
public ItemStack getOutput(ItemStack item)
{
NBTTagCompound encodedValue = item.getTagCompound();
if ( encodedValue == null )
return null;
NBTTagList outTag = encodedValue.getTagList( "out", 10 );
if ( outTag.tagCount() == 0 )
return null;
ItemStack out = null;
for (int x = 0; x < outTag.tagCount(); x++)
{
ItemStack readItem = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( x ) );
if ( readItem != null )
{
if ( out == null )
out = readItem;
else if ( out != null && Platform.isSameItemPrecise( readItem, out ) )
out.stackSize += readItem.stackSize;
}
}
return out;
}
private void readItems(ItemStack[] itemList, NBTTagList tagSrc)
{
for (int x = 0; x < itemList.length; x++)