Merge pull request #1813 from yueh/fix-1481

Fixes #1481: Not using the right itemcount in a few cases
This commit is contained in:
yueh 2015-08-16 15:39:33 +02:00
commit 1ecc811559

View file

@ -395,6 +395,7 @@ public class CellInventory implements ICellInventory
* if ( tagType instanceof NBTTagShort ) ((NBTTagShort) tagType).data = storedItems = (short) cellItems.size();
* else
*/
this.storedItems = (short) this.cellItems.size();
if( this.cellItems.isEmpty() )
{
this.tagCompound.removeTag( ITEM_TYPE_TAG );
@ -403,11 +404,11 @@ public class CellInventory implements ICellInventory
{
this.tagCompound.setShort( ITEM_TYPE_TAG, this.storedItems );
}
this.storedItems = (short) this.cellItems.size();
/*
* if ( tagCount instanceof NBTTagInt ) ((NBTTagInt) tagCount).data = storedItemCount = itemCount; else
*/
this.storedItemCount = itemCount;
if( itemCount == 0 )
{
this.tagCompound.removeTag( ITEM_COUNT_TAG );
@ -416,7 +417,6 @@ public class CellInventory implements ICellInventory
{
this.tagCompound.setInteger( ITEM_COUNT_TAG, itemCount );
}
this.storedItemCount = itemCount;
// clean any old crusty stuff...
for( ; x < oldStoredItems && x < this.maxItemTypes; x++ )