use of com.porpit.minecamera.tileentity.TileEntityPhotoProcessor in project MineCamera by PorPit.
the class BlockPhotoProcessor method breakBlock.
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
TileEntityPhotoProcessor te = (TileEntityPhotoProcessor) worldIn.getTileEntity(pos);
IItemHandler inv = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP);
for (int i = inv.getSlots() - 1; i >= 0; --i) {
if (inv.getStackInSlot(i) != null) {
Block.spawnAsEntity(worldIn, pos, inv.getStackInSlot(i));
((IItemHandlerModifiable) inv).setStackInSlot(i, null);
}
}
super.breakBlock(worldIn, pos, state);
}
Aggregations