super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
TileFunnel funnel = (TileFunnel) par1World.getTileEntity(par2, par3, par4);
ItemStack stack = funnel.getStackInSlot(0);
if (stack == null) {
ItemStack playerStack = par5EntityPlayer.getCurrentEquippedItem();
if (funnel.canInsertItem(0, playerStack, 1)) {
funnel.setInventorySlotContents(0, playerStack.splitStack(1));
if (playerStack.stackSize <= 0)
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
funnel.markDirty();
return true;
}
} else {
if (!par5EntityPlayer.inventory.addItemStackToInventory(stack))
par5EntityPlayer.dropPlayerItemWithRandomChoice(stack, false);
funnel.setInventorySlotContents(0, null);
funnel.markDirty();
return true;
}
return false;
}