Java Code Examples for codechicken.lib.inventory.InventoryUtils#dropItem()

The following examples show how to use codechicken.lib.inventory.InventoryUtils#dropItem() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TileTranslocator.java    From Translocators with MIT License 4 votes vote down vote up
public void dropItem(ItemStack stack)
{
    InventoryUtils.dropItem(stack, worldObj, Vector3.fromTileEntityCenter(this));
}
 
Example 2
Source File: TileCraftingGrid.java    From Translocators with MIT License 4 votes vote down vote up
public void dropItems() {
    Vector3 drop = Vector3.fromTileEntityCenter(this);
    for (ItemStack item : items)
        if (item != null)
            InventoryUtils.dropItem(item, worldObj, drop);
}
 
Example 3
Source File: TileCraftingGrid.java    From Translocators with MIT License 4 votes vote down vote up
private void giveOrDropItem(ItemStack stack, EntityPlayer player) {
    if (player.inventory.addItemStackToInventory(stack))
        player.inventoryContainer.detectAndSendChanges();
    else
        InventoryUtils.dropItem(stack, worldObj, Vector3.fromTileEntityCenter(this));
}