// Path: src/main/java/charcoalPit/tile/TileBloom.java
// public class TileBloom extends TileEntity{
// 	
// 	public ItemStackHandler items;
// 	public int slag;
// 	public TileBloom() {
// 		items=new ItemStackHandler();
// 		slag=0;
// 	}
// 	
// 	public void dropInventory(){
// 		BlockPos hatch=gethatchPos();
// 		spawnItemStack(items.getStackInSlot(0), hatch);
// 		if(slag>0){
// 			for(int i=0;i<slag;i++){
// 				Random r=new Random();
// 				if(r.nextFloat()<Config.BloomSlagChance){
// 					InventoryHelper.spawnItemStack(world, hatch.getX(), hatch.getY(), hatch.getZ(), ItemsRegistry.rich_slag_stack.copy());
// 				}else{
// 					InventoryHelper.spawnItemStack(world, hatch.getX(), hatch.getY(), hatch.getZ(), ItemsRegistry.slag_stack.copy());
// 				}
// 			}
// 			while(slag>0){
// 				int i=EntityXPOrb.getXPSplit(slag);
// 				slag-=i;
// 				world.spawnEntity(new EntityXPOrb(world, (double)hatch.getX() + 0.5D, (double)hatch.getY() + 0.5D, (double)hatch.getZ() + 0.5D, i));
// 			}
// 		}
// 	}
// 	
// 	public void spawnItemStack(ItemStack stack, BlockPos pos){
// 		Random r=new Random();
// 		float f = r.nextFloat() * 0.8F + 0.1F;
//         float f1 = r.nextFloat() * 0.8F + 0.1F;
//         float f2 = r.nextFloat() * 0.8F + 0.1F;
// 
//         while (!stack.isEmpty())
//         {
//             EntityItem entityitem = new EntityItem(world, pos.getX() + (double)f, pos.getY() + (double)f1, pos.getZ() + (double)f2, stack.splitStack(r.nextInt(21) + 10));
//             entityitem.motionX = r.nextGaussian() * 0.05000000074505806D;
//             entityitem.motionY = r.nextGaussian() * 0.05000000074505806D + 0.20000000298023224D;
//             entityitem.motionZ = r.nextGaussian() * 0.05000000074505806D;
//             entityitem.setThrower("Bloom");
//             world.spawnEntity(entityitem);
//         }
// 	}
// 	
// 	public BlockPos gethatchPos(){
// 		for(EnumFacing facing:EnumFacing.HORIZONTALS){
// 			if(world.getBlockState(pos.offset(facing)).getBlock()==BlocksRegistry.hatch)
// 				return pos.offset(facing);
// 		}
// 		return pos;
// 	}
// 	
// 	@Override
// 	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
// 		super.writeToNBT(compound);
// 		compound.setTag("items", items.serializeNBT());
// 		compound.setInteger("slag", slag);
// 		return compound;
// 	}
// 	
// 	@Override
// 	public void readFromNBT(NBTTagCompound compound) {
// 		super.readFromNBT(compound);
// 		items.deserializeNBT(compound.getCompoundTag("items"));
// 		slag=compound.getInteger("slag");
// 	}
// 	
// }


import charcoalPit.tile.TileBloom;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
package charcoalPit.blocks;


public class BlockBloom extends BlockBase implements ITileEntityProvider{

	public BlockBloom() {
		super(Material.ROCK, "bloom");
		setHardness(5);
		setHarvestLevel("pickaxe", 1);
		setSoundType(BlockSmeltedPot.BROKEN_POT);
	}
	
	@Override
	public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
// Path: src/main/java/charcoalPit/tile/TileBloom.java
// public class TileBloom extends TileEntity{
// 	
// 	public ItemStackHandler items;
// 	public int slag;
// 	public TileBloom() {
// 		items=new ItemStackHandler();
// 		slag=0;
// 	}
// 	
// 	public void dropInventory(){
// 		BlockPos hatch=gethatchPos();
// 		spawnItemStack(items.getStackInSlot(0), hatch);
// 		if(slag>0){
// 			for(int i=0;i<slag;i++){
// 				Random r=new Random();
// 				if(r.nextFloat()<Config.BloomSlagChance){
// 					InventoryHelper.spawnItemStack(world, hatch.getX(), hatch.getY(), hatch.getZ(), ItemsRegistry.rich_slag_stack.copy());
// 				}else{
// 					InventoryHelper.spawnItemStack(world, hatch.getX(), hatch.getY(), hatch.getZ(), ItemsRegistry.slag_stack.copy());
// 				}
// 			}
// 			while(slag>0){
// 				int i=EntityXPOrb.getXPSplit(slag);
// 				slag-=i;
// 				world.spawnEntity(new EntityXPOrb(world, (double)hatch.getX() + 0.5D, (double)hatch.getY() + 0.5D, (double)hatch.getZ() + 0.5D, i));
// 			}
// 		}
// 	}
// 	
// 	public void spawnItemStack(ItemStack stack, BlockPos pos){
// 		Random r=new Random();
// 		float f = r.nextFloat() * 0.8F + 0.1F;
//         float f1 = r.nextFloat() * 0.8F + 0.1F;
//         float f2 = r.nextFloat() * 0.8F + 0.1F;
// 
//         while (!stack.isEmpty())
//         {
//             EntityItem entityitem = new EntityItem(world, pos.getX() + (double)f, pos.getY() + (double)f1, pos.getZ() + (double)f2, stack.splitStack(r.nextInt(21) + 10));
//             entityitem.motionX = r.nextGaussian() * 0.05000000074505806D;
//             entityitem.motionY = r.nextGaussian() * 0.05000000074505806D + 0.20000000298023224D;
//             entityitem.motionZ = r.nextGaussian() * 0.05000000074505806D;
//             entityitem.setThrower("Bloom");
//             world.spawnEntity(entityitem);
//         }
// 	}
// 	
// 	public BlockPos gethatchPos(){
// 		for(EnumFacing facing:EnumFacing.HORIZONTALS){
// 			if(world.getBlockState(pos.offset(facing)).getBlock()==BlocksRegistry.hatch)
// 				return pos.offset(facing);
// 		}
// 		return pos;
// 	}
// 	
// 	@Override
// 	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
// 		super.writeToNBT(compound);
// 		compound.setTag("items", items.serializeNBT());
// 		compound.setInteger("slag", slag);
// 		return compound;
// 	}
// 	
// 	@Override
// 	public void readFromNBT(NBTTagCompound compound) {
// 		super.readFromNBT(compound);
// 		items.deserializeNBT(compound.getCompoundTag("items"));
// 		slag=compound.getInteger("slag");
// 	}
// 	
// }


// Path: src/main/java/charcoalPit/blocks/BlockBloom.java
import charcoalPit.tile.TileBloom;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

package charcoalPit.blocks;


public class BlockBloom extends BlockBase implements ITileEntityProvider{

	public BlockBloom() {
		super(Material.ROCK, "bloom");
		setHardness(5);
		setHarvestLevel("pickaxe", 1);
		setSoundType(BlockSmeltedPot.BROKEN_POT);
	}
	
	@Override
	public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
		((TileBloom)worldIn.getTileEntity(pos)).dropInventory();