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
@@ -308,7 +308,7 @@ public abstract class CastingBlockLogic extends InventoryLogic implements IFluid
if(isStackInSlot(1))
slot = 1;
// Additional Info: Only 1 item can only be put into the casting block usually, however recipies
// Additional Info: Only 1 item can only be put into the casting block usually, however recipes
// can have multiple blocks as output (compressed gravel -> brownstone for example)
// we therefore spill the whole contents on extraction