Java Code Examples for net.minecraft.inventory.InventoryHelper#dropInventoryItems()

The following examples show how to use net.minecraft.inventory.InventoryHelper#dropInventoryItems() . 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: BlockSaltFurnace.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    if (!keepInventory)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntitySaltFurnace)
        {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntitySaltFurnace)tileentity);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 2
Source File: BlockTFOven.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    if (!keepInventory)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityTFOven)
        {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFOven)tileentity);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 3
Source File: BlockAdvancedAggregator.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    if (!keepInventory)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntitySoymilkAdvancedAggregator)
        {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntitySoymilkAdvancedAggregator)tileentity);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 4
Source File: BlockAggregator.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    if (!keepInventory)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntitySoymilkAggregator)
        {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntitySoymilkAggregator)tileentity);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 5
Source File: BlockTFCrasher.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    if (!keepInventory)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityTFCrasher)
        {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFCrasher)tileentity);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 6
Source File: BlockTFCompressor.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    if (!keepInventory)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityTFCompressor)
        {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFCompressor)tileentity);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 7
Source File: BlockTFBattery.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    TileEntity tileentity = worldIn.getTileEntity(pos);
    if (tileentity instanceof TileEntityTofuBattery) {
        InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTofuBattery) tileentity);
        worldIn.updateComparatorOutputLevel(pos, this);
    }
    super.breakBlock(worldIn, pos, state);
}
 
Example 8
Source File: BlockTFStorage.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    TileEntity tileentity = worldIn.getTileEntity(pos);
    if (tileentity instanceof TileEntityTFStorage) {
        InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFStorage) tileentity);
        worldIn.updateComparatorOutputLevel(pos, this);
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 9
Source File: BlockMapleSyrupCauldron.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    if (!keepInventory) {
        TileEntity te = worldIn.getTileEntity(pos);
        if (te instanceof TileEntityMapleCauldron) {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMapleCauldron)te);
            worldIn.updateComparatorOutputLevel(pos, this);
        }
    }
    super.breakBlock(worldIn, pos, state);
}
 
Example 10
Source File: BlockStoneMortar.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    TileEntity tileentity = worldIn.getTileEntity(pos);
    if (tileentity instanceof TileEntityStoneMortar) {
        InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityStoneMortar) tileentity);
        worldIn.updateComparatorOutputLevel(pos, this);
    }
    super.breakBlock(worldIn, pos, state);
}
 
Example 11
Source File: BlockCampfirePot.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    if (!keepInventory) {
        TileEntity te = worldIn.getTileEntity(pos);
        if (te instanceof TileEntityCampfirePot) {
            InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityCampfirePot)te);
            worldIn.updateComparatorOutputLevel(pos, this);
        }

        spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(BlockLoader.CAMPFIRE_IDLE)));
        spawnAsEntity(worldIn, pos, new ItemStack(ItemLoader.POT));
    }

    super.breakBlock(worldIn, pos, state);
}
 
Example 12
Source File: BlockMinecoprocessor.java    From Minecoprocessors with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
  notifyNeighbors(worldIn, pos, state);

  TileEntity tileentity = worldIn.getTileEntity(pos);
  if (tileentity instanceof TileEntityMinecoprocessor) {
    InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMinecoprocessor) tileentity);
  }
  super.breakBlock(worldIn, pos, state);
}
 
Example 13
Source File: BlockFirepit.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
	TileEntity tileentity = worldIn.getTileEntity(pos);

	if (tileentity instanceof IInventory)
	{
		InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity);
		worldIn.updateComparatorOutputLevel(pos, this);
	}

	super.breakBlock(worldIn, pos, state);
}