// Path: src/main/java/charcoalPit/tile/TileActivePile.java
// public class TileActivePile extends TileEntity implements ITickable{
// 
// 	//18H=18000ticks
// 	public int invalidTicks;
// 	public int burnTime;
// 	public int itemsLeft;
// 	public boolean isValid;
// 	public boolean isCoke;
// 	public FluidTank creosote;
// 	public TileActivePile() {
// 		this(false);
// 	}
// 	public TileActivePile(boolean coal) {
// 		invalidTicks=0;
// 		burnTime=isCoke?Config.CokeTime/10:Config.CharcoalTime/10;
// 		itemsLeft=9;
// 		isValid=false;
// 		isCoke=coal;
// 		creosote=new FluidTank(1000);
// 	}
// 	@Override
// 	public void update() {
// 		if(!this.world.isRemote){
// 			checkValid();
// 			if(burnTime>0){
// 				burnTime--;
// 			}else{
// 				if(itemsLeft>0){
// 					itemsLeft--;
// 					creosote.fill(FluidRegistry.getFluidStack("creosote", isCoke?Config.CokeCreosote:Config.CharcoalCreosote), true);
// 					burnTime=isCoke?Config.CokeTime/10:Config.CharcoalTime/10;
// 				}else{
// 					this.world.setBlockState(this.pos, isCoke?BlocksRegistry.cokePile.getDefaultState():BlocksRegistry.charcoalPile.getDefaultState());
// 				}
// 			}
// 			if(creosote.getFluidAmount()>0){
// 				if(this.world.getTileEntity(this.pos.offset(EnumFacing.DOWN))instanceof TileActivePile){
// 					TileActivePile down=(TileActivePile)this.world.getTileEntity(this.pos.offset(EnumFacing.DOWN));
// 					creosote.drain(down.creosote.fill(creosote.getFluid(), true), true);
// 				}
// 			}
// 		}
// 	}
// 	public void checkValid(){
// 		if(!isValid){
// 			boolean valid=true;
// 			EnumFacing[] neighbors=EnumFacing.VALUES;
// 			//check structure
// 			for(EnumFacing facing:neighbors){
// 				if(!MethodHelper.CharcoalPitIsValidBlock(world, this.pos, facing, isCoke)){
// 					valid=false;
// 					break;
// 				}
// 			}
// 			if(valid){
// 				isValid=true;
// 				invalidTicks=0;
// 			}else{
// 				if(invalidTicks<100){
// 					invalidTicks++;
// 					for(EnumFacing facing:neighbors){
// 						//set fire
// 						IBlockState block=this.world.getBlockState(this.pos.offset(facing));
// 						if(block.getBlock().isAir(block, this.world, this.pos.offset(facing))||
// 								block.getBlock().isReplaceable(this.world, this.pos.offset(facing))){
// 							this.world.setBlockState(this.pos.offset(facing), Blocks.FIRE.getDefaultState());
// 						}
// 					}
// 				}else{
// 					this.world.setBlockToAir(this.pos);
// 				}
// 			}
// 		}
// 	}
// 	@Override
// 	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
// 		super.writeToNBT(compound);
// 		compound.setInteger("invalid", invalidTicks);
// 		compound.setInteger("time", burnTime);
// 		compound.setInteger("items", itemsLeft);
// 		compound.setBoolean("valid", isValid);
// 		compound.setBoolean("coke", isCoke);
// 		compound.setTag("creosote", creosote.writeToNBT(new NBTTagCompound()));
// 		return compound;
// 	}
// 	@Override
// 	public void readFromNBT(NBTTagCompound compound) {
// 		super.readFromNBT(compound);
// 		invalidTicks=compound.getInteger("invalid");
// 		burnTime=compound.getInteger("time");
// 		itemsLeft=compound.getInteger("items");
// 		isValid=compound.getBoolean("valid");
// 		isCoke=compound.getBoolean("coke");
// 		creosote.readFromNBT(compound.getCompoundTag("creosote"));
// 	}
// 
// }


import java.util.Random;
import charcoalPit.tile.TileActivePile;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
package charcoalPit.blocks;



public class BlockActivePile extends BlockBase implements ITileEntityProvider{

	public final Boolean isCoal;
	public BlockActivePile(Material materialIn, String name,Boolean coal) {
		super(materialIn, name);
		isCoal=coal;
		setHardness(isCoal?5:2);
		setHarvestLevel(isCoal?"pickaxe":"axe", 0);
		setSoundType(isCoal?SoundType.STONE:SoundType.WOOD);
	}
	@Override
	public void register() {
		ForgeRegistries.BLOCKS.register(this);
	}
	@Override
	public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
// Path: src/main/java/charcoalPit/tile/TileActivePile.java
// public class TileActivePile extends TileEntity implements ITickable{
// 
// 	//18H=18000ticks
// 	public int invalidTicks;
// 	public int burnTime;
// 	public int itemsLeft;
// 	public boolean isValid;
// 	public boolean isCoke;
// 	public FluidTank creosote;
// 	public TileActivePile() {
// 		this(false);
// 	}
// 	public TileActivePile(boolean coal) {
// 		invalidTicks=0;
// 		burnTime=isCoke?Config.CokeTime/10:Config.CharcoalTime/10;
// 		itemsLeft=9;
// 		isValid=false;
// 		isCoke=coal;
// 		creosote=new FluidTank(1000);
// 	}
// 	@Override
// 	public void update() {
// 		if(!this.world.isRemote){
// 			checkValid();
// 			if(burnTime>0){
// 				burnTime--;
// 			}else{
// 				if(itemsLeft>0){
// 					itemsLeft--;
// 					creosote.fill(FluidRegistry.getFluidStack("creosote", isCoke?Config.CokeCreosote:Config.CharcoalCreosote), true);
// 					burnTime=isCoke?Config.CokeTime/10:Config.CharcoalTime/10;
// 				}else{
// 					this.world.setBlockState(this.pos, isCoke?BlocksRegistry.cokePile.getDefaultState():BlocksRegistry.charcoalPile.getDefaultState());
// 				}
// 			}
// 			if(creosote.getFluidAmount()>0){
// 				if(this.world.getTileEntity(this.pos.offset(EnumFacing.DOWN))instanceof TileActivePile){
// 					TileActivePile down=(TileActivePile)this.world.getTileEntity(this.pos.offset(EnumFacing.DOWN));
// 					creosote.drain(down.creosote.fill(creosote.getFluid(), true), true);
// 				}
// 			}
// 		}
// 	}
// 	public void checkValid(){
// 		if(!isValid){
// 			boolean valid=true;
// 			EnumFacing[] neighbors=EnumFacing.VALUES;
// 			//check structure
// 			for(EnumFacing facing:neighbors){
// 				if(!MethodHelper.CharcoalPitIsValidBlock(world, this.pos, facing, isCoke)){
// 					valid=false;
// 					break;
// 				}
// 			}
// 			if(valid){
// 				isValid=true;
// 				invalidTicks=0;
// 			}else{
// 				if(invalidTicks<100){
// 					invalidTicks++;
// 					for(EnumFacing facing:neighbors){
// 						//set fire
// 						IBlockState block=this.world.getBlockState(this.pos.offset(facing));
// 						if(block.getBlock().isAir(block, this.world, this.pos.offset(facing))||
// 								block.getBlock().isReplaceable(this.world, this.pos.offset(facing))){
// 							this.world.setBlockState(this.pos.offset(facing), Blocks.FIRE.getDefaultState());
// 						}
// 					}
// 				}else{
// 					this.world.setBlockToAir(this.pos);
// 				}
// 			}
// 		}
// 	}
// 	@Override
// 	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
// 		super.writeToNBT(compound);
// 		compound.setInteger("invalid", invalidTicks);
// 		compound.setInteger("time", burnTime);
// 		compound.setInteger("items", itemsLeft);
// 		compound.setBoolean("valid", isValid);
// 		compound.setBoolean("coke", isCoke);
// 		compound.setTag("creosote", creosote.writeToNBT(new NBTTagCompound()));
// 		return compound;
// 	}
// 	@Override
// 	public void readFromNBT(NBTTagCompound compound) {
// 		super.readFromNBT(compound);
// 		invalidTicks=compound.getInteger("invalid");
// 		burnTime=compound.getInteger("time");
// 		itemsLeft=compound.getInteger("items");
// 		isValid=compound.getBoolean("valid");
// 		isCoke=compound.getBoolean("coke");
// 		creosote.readFromNBT(compound.getCompoundTag("creosote"));
// 	}
// 
// }


// Path: src/main/java/charcoalPit/blocks/BlockActivePile.java
import java.util.Random;
import charcoalPit.tile.TileActivePile;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.ForgeRegistries;

package charcoalPit.blocks;



public class BlockActivePile extends BlockBase implements ITileEntityProvider{

	public final Boolean isCoal;
	public BlockActivePile(Material materialIn, String name,Boolean coal) {
		super(materialIn, name);
		isCoal=coal;
		setHardness(isCoal?5:2);
		setHarvestLevel(isCoal?"pickaxe":"axe", 0);
		setSoundType(isCoal?SoundType.STONE:SoundType.WOOD);
	}
	@Override
	public void register() {
		ForgeRegistries.BLOCKS.register(this);
	}
	@Override
	public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
		((TileActivePile)worldIn.getTileEntity(pos)).isValid=false;