Port the weird possible casting-block-dupe fix over to the drying rack #1190

This commit is contained in:
Bernhard Bonigl committed 2014-11-23 18:30:19 +01:00
1 parent 9af43cbe9e
commit 6d677dcc7a
2 files changed
+9 -8

No files matched your search

@@ -96,12 +96,9 @@ public class DryingRack extends InventoryBlock
}
else
{
if (logic.isStackInSlot(0))
{
ItemStack decrStack = logic.decrStackSize(0, 1);
if (decrStack != null)
addItemToInventory(player, world, x, y, z, decrStack);
}
ItemStack decrStack = logic.decrStackSize(0, 1);
if (decrStack != null)
addItemToInventory(player, world, x, y, z, decrStack);
}
world.markBlockForUpdate(x, y, z);
@@ -111,7 +108,11 @@ public class DryingRack extends InventoryBlock
public void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack)
{
AbilityHelper.spawnItemAtPlayer(player, stack);
if(!player.inventory.addItemStackToInventory(stack))
{
// drop the rest as an item
AbilityHelper.spawnItemAtPlayer(player, stack);
}
}
@Override