Skip to content

Commit

Permalink
Remove special inventory-spawn-code in other blocks since it's handle…
Browse files Browse the repository at this point in the history
…d by AbilityHelper now
  • Loading branch information
bonii-xx committed Nov 25, 2014
1 parent 158ae52 commit 90e5d6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
11 changes: 1 addition & 10 deletions src/main/java/tconstruct/armor/blocks/DryingRack.java
Expand Up @@ -98,23 +98,14 @@ boolean activateDryingRack (World world, int x, int y, int z, EntityPlayer playe
{
ItemStack decrStack = logic.decrStackSize(0, 1);
if (decrStack != null)
addItemToInventory(player, world, x, y, z, decrStack);
AbilityHelper.spawnItemAtPlayer(player, decrStack);
}

world.markBlockForUpdate(x, y, z);
}
return true;
}

public void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack)
{
if(!player.inventory.addItemStackToInventory(stack))
{
// drop the rest as an item
AbilityHelper.spawnItemAtPlayer(player, stack);
}
}

@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool (World world, int x, int y, int z)
{
Expand Down
Expand Up @@ -317,14 +317,7 @@ public void interact(EntityPlayer player)

// try to transfer thes tack to the player inventory
ItemStack output = event.item;
if(!player.inventory.addItemStackToInventory(output))
{
// drop the rest as an item
AbilityHelper.spawnItemAtPlayer(player, output);
}
// added to inventory, update inventory
else
player.inventory.markDirty();
AbilityHelper.spawnItemAtPlayer(player, output);

// remove inventory contents, since we spilled the full contents of the slot
inventory[slot] = null;
Expand Down

0 comments on commit 90e5d6a

Please sign in to comment.