Skip to content

Commit

Permalink
Port the weird possible casting-block-dupe fix over to the drying rack
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Nov 23, 2014
1 parent 9af43cb commit 6d677dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/main/java/tconstruct/armor/blocks/DryingRack.java
Expand Up @@ -96,12 +96,9 @@ boolean activateDryingRack (World world, int x, int y, int z, EntityPlayer playe
}
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);
Expand All @@ -111,7 +108,11 @@ boolean activateDryingRack (World world, int x, int y, int z, EntityPlayer playe

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
Expand Down
Expand Up @@ -308,7 +308,7 @@ public void interact(EntityPlayer player)
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

Expand Down

0 comments on commit 6d677dc

Please sign in to comment.