// Path: src/java/cd4017be/kineng/tileentity/CircularMultiblockPart.java
// public class CircularMultiblockPart extends BaseTileEntity implements INeighborAwareTile, ITilePlaceHarvest {
// 
// 	public CircularMultiblockCore link;
// 	public double r, m, v;
// 	public IBlockState storedBlock = Blocks.AIR.getDefaultState();
// 	public boolean isLinked;
// 
// 	public void link(CircularMultiblockCore target) {
// 		if (link == target) return;
// 		link = target;
// 		isLinked = true;
// 		r = Math.sqrt(pos.distanceSq(target.getPos()));
// 		link.mergeMomentum(m * r * r, m * r * v);
// 		markDirty(REDRAW);
// 	}
// 
// 	public void unlink() {
// 		if (link == null) return;
// 		link.remove(this);
// 		link = null;
// 		isLinked = false;
// 		if (!unloaded) markDirty(REDRAW);
// 	}
// 
// 	@Override
// 	protected void onUnload() {
// 		super.onUnload();
// 		unlink();
// 	}
// 
// 	@Override
// 	protected void storeState(NBTTagCompound nbt, int mode) {
// 		super.storeState(nbt, mode);
// 		if (mode == SAVE) {
// 			nbt.setDouble("m", m);
// 			if (link != null) v = link.shaft.av() * r;
// 			nbt.setDouble("v", v);
// 		}
// 		nbt.setInteger("block", Block.getStateId(storedBlock));
// 		if (mode >= CLIENT) nbt.setBoolean("lk", isLinked);
// 	}
// 
// 	@Override
// 	protected void loadState(NBTTagCompound nbt, int mode) {
// 		super.loadState(nbt, mode);
// 		if (mode == SAVE) {
// 			m = nbt.getDouble("m");
// 			v = nbt.getDouble("v");
// 		}
// 		storedBlock = Block.getStateById(nbt.getInteger("block"));
// 		if (mode >= CLIENT) isLinked = nbt.getBoolean("lk");
// 	}
// 
// 	@Override
// 	public void neighborBlockChange(Block b, BlockPos src) {
// 		if (link != null) link.neighborBlockChange(b, src);
// 	}
// 
// 	@Override
// 	public void onPlaced(EntityLivingBase entity, ItemStack item) {}
// 
// 	@Override
// 	public List<ItemStack> dropItem(IBlockState state, int fortune) {
// 		NonNullList<ItemStack> list = NonNullList.create();
// 		storedBlock.getBlock().getDrops(list, world, pos, storedBlock, fortune);
// 		return list;
// 	}
// 
// 	@Override
// 	public void neighborTileChange(TileEntity te, EnumFacing side) {}
// 
// }


import cd4017be.kineng.tileentity.CircularMultiblockPart;
import cd4017be.lib.block.AdvancedBlock;
import cd4017be.lib.property.PropertyBlockMimic;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;

package cd4017be.kineng.block;


public class BlockFillCustom extends AdvancedBlock {

	public static final PropertyBool linked = PropertyBool.create("link");

	public BlockFillCustom(String id, Material m, SoundType sound, Class<? extends TileEntity> tile) {
		super(id, m, sound, 3, tile);
		setDefaultState(getBlockState().getBaseState().withProperty(linked, false));
	}

	@Override
	protected BlockStateContainer createBlockState() {
		return new ExtendedBlockState(this, new IProperty[]{linked}, new IUnlistedProperty[] {PropertyBlockMimic.instance});
	}

	@Override
	public IBlockState getStateFromMeta(int meta) {
		return getDefaultState();
	}

	@Override
	public int getMetaFromState(IBlockState state) {
		return 0;
	}

	@Override
	public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
		TileEntity te = world.getTileEntity(pos);

// Path: src/java/cd4017be/kineng/tileentity/CircularMultiblockPart.java
// public class CircularMultiblockPart extends BaseTileEntity implements INeighborAwareTile, ITilePlaceHarvest {
// 
// 	public CircularMultiblockCore link;
// 	public double r, m, v;
// 	public IBlockState storedBlock = Blocks.AIR.getDefaultState();
// 	public boolean isLinked;
// 
// 	public void link(CircularMultiblockCore target) {
// 		if (link == target) return;
// 		link = target;
// 		isLinked = true;
// 		r = Math.sqrt(pos.distanceSq(target.getPos()));
// 		link.mergeMomentum(m * r * r, m * r * v);
// 		markDirty(REDRAW);
// 	}
// 
// 	public void unlink() {
// 		if (link == null) return;
// 		link.remove(this);
// 		link = null;
// 		isLinked = false;
// 		if (!unloaded) markDirty(REDRAW);
// 	}
// 
// 	@Override
// 	protected void onUnload() {
// 		super.onUnload();
// 		unlink();
// 	}
// 
// 	@Override
// 	protected void storeState(NBTTagCompound nbt, int mode) {
// 		super.storeState(nbt, mode);
// 		if (mode == SAVE) {
// 			nbt.setDouble("m", m);
// 			if (link != null) v = link.shaft.av() * r;
// 			nbt.setDouble("v", v);
// 		}
// 		nbt.setInteger("block", Block.getStateId(storedBlock));
// 		if (mode >= CLIENT) nbt.setBoolean("lk", isLinked);
// 	}
// 
// 	@Override
// 	protected void loadState(NBTTagCompound nbt, int mode) {
// 		super.loadState(nbt, mode);
// 		if (mode == SAVE) {
// 			m = nbt.getDouble("m");
// 			v = nbt.getDouble("v");
// 		}
// 		storedBlock = Block.getStateById(nbt.getInteger("block"));
// 		if (mode >= CLIENT) isLinked = nbt.getBoolean("lk");
// 	}
// 
// 	@Override
// 	public void neighborBlockChange(Block b, BlockPos src) {
// 		if (link != null) link.neighborBlockChange(b, src);
// 	}
// 
// 	@Override
// 	public void onPlaced(EntityLivingBase entity, ItemStack item) {}
// 
// 	@Override
// 	public List<ItemStack> dropItem(IBlockState state, int fortune) {
// 		NonNullList<ItemStack> list = NonNullList.create();
// 		storedBlock.getBlock().getDrops(list, world, pos, storedBlock, fortune);
// 		return list;
// 	}
// 
// 	@Override
// 	public void neighborTileChange(TileEntity te, EnumFacing side) {}
// 
// }


// Path: src/java/cd4017be/kineng/block/BlockFillCustom.java
import cd4017be.kineng.tileentity.CircularMultiblockPart;
import cd4017be.lib.block.AdvancedBlock;
import cd4017be.lib.property.PropertyBlockMimic;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;

package cd4017be.kineng.block;


public class BlockFillCustom extends AdvancedBlock {

	public static final PropertyBool linked = PropertyBool.create("link");

	public BlockFillCustom(String id, Material m, SoundType sound, Class<? extends TileEntity> tile) {
		super(id, m, sound, 3, tile);
		setDefaultState(getBlockState().getBaseState().withProperty(linked, false));
	}

	@Override
	protected BlockStateContainer createBlockState() {
		return new ExtendedBlockState(this, new IProperty[]{linked}, new IUnlistedProperty[] {PropertyBlockMimic.instance});
	}

	@Override
	public IBlockState getStateFromMeta(int meta) {
		return getDefaultState();
	}

	@Override
	public int getMetaFromState(IBlockState state) {
		return 0;
	}

	@Override
	public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
		TileEntity te = world.getTileEntity(pos);

		if (te instanceof CircularMultiblockPart)
