// Path: src/java/cd4017be/kineng/block/BlockRotaryTool.java
// public class BlockRotaryTool extends BlockShaft {
// 
// 	public double maxF;
// 	public final int type;
// 	public ItemStack scrap = ItemStack.EMPTY;
// 
// 	/**
// 	 * @param id
// 	 * @param m
// 	 * @param r
// 	 * @param tile
// 	 */
// 	public BlockRotaryTool(String id, ShaftMaterial m, int type, double r, Class<? extends TileEntity> tile) {
// 		super(id, m, r, tile);
// 		this.type = type;
// 	}
// 
// 	@Override
// 	public double J(IBlockState state) {
// 		return J_dens;
// 	}
// 
// 	@Override
// 	public double getDebris(IBlockState state, List<ItemStack> items) {
// 		items.add(shaftMat.scrap);
// 		items.add(scrap);
// 		return r;
// 	}
// 
// 	public void setMaterials(ShaftMaterial mat, double r, double h) {
// 		J_dens = Formula.J_biCylinder(0.25, shaftMat.density, r, mat.density, h);
// 		av_max = Math.min(
// 			Formula.rip_vel(shaftMat.strength / shaftMat.density, 0.25),
// 			Formula.rip_vel(mat.strength / mat.density, r)
// 		);
// 	}
// 
// 	@Override
// 	@SideOnly(Side.CLIENT)
// 	protected void addInformation(IBlockState state, List<String> tooltip, ITooltipFlag advanced) {
// 		super.addInformation(state, tooltip, advanced);
// 		tooltip.add(TooltipUtil.format("info.kineng.toolstats", radius(state), maxF));
// 	}
// 
// }


import static net.minecraft.util.EnumFacing.AxisDirection.POSITIVE;
import java.util.*;
import cd4017be.kineng.block.BlockRotaryTool;
import cd4017be.kineng.physics.*;
import cd4017be.lib.block.AdvancedBlock.IInteractiveTile;
import cd4017be.lib.block.AdvancedBlock.INeighborAwareTile;
import cd4017be.lib.tileentity.BaseTileEntity.ITickableServerOnly;
import cd4017be.lib.util.TooltipUtil;
import cd4017be.math.cplx.CplxF;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.entity.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.*;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.chunk.Chunk;

				|| Math.abs(px - lh.posX) + Math.abs(pz - lh.posZ) >= 0.25
				|| e.getHealth() < e.getMaxHealth()
			) continue;
			CplxF str = ENTITY_STRENGTH.get(e.getClass());
			if (str == null) continue;
			double F = Math.copySign(str.r, lh.posY - py), dv = v * F / str.i - 0.5;
			dv = Math.max(1.0 - 4.0 * dv * dv, 0);
			if (e instanceof EntityAgeable) {
				EntityAgeable ea = (EntityAgeable)e;
				int age = ea.getGrowingAge();
				if (age < -MAX_TIME) {
					F = 0;
					dv = 0;
				} else {
					if (age > 0) age = 0;
					remT += Math.max(age + MAX_TIME, 0);
				}
				ea.setGrowingAge(age - (int)(CHECK_INTERVAL * (1.0 + dv)));
				n++;
			} else if (rand.nextFloat() < dv)
				e.setHealth(e.getMaxHealth() * 0.5F);
			acc.add(str);
			force.F += F;
		}
		if (force.F != 0)
			force.Fdv = -Math.abs(force.F * acc.r / acc.i);
		if (n > 0) remT /= n;
	}

	@Override

// Path: src/java/cd4017be/kineng/block/BlockRotaryTool.java
// public class BlockRotaryTool extends BlockShaft {
// 
// 	public double maxF;
// 	public final int type;
// 	public ItemStack scrap = ItemStack.EMPTY;
// 
// 	/**
// 	 * @param id
// 	 * @param m
// 	 * @param r
// 	 * @param tile
// 	 */
// 	public BlockRotaryTool(String id, ShaftMaterial m, int type, double r, Class<? extends TileEntity> tile) {
// 		super(id, m, r, tile);
// 		this.type = type;
// 	}
// 
// 	@Override
// 	public double J(IBlockState state) {
// 		return J_dens;
// 	}
// 
// 	@Override
// 	public double getDebris(IBlockState state, List<ItemStack> items) {
// 		items.add(shaftMat.scrap);
// 		items.add(scrap);
// 		return r;
// 	}
// 
// 	public void setMaterials(ShaftMaterial mat, double r, double h) {
// 		J_dens = Formula.J_biCylinder(0.25, shaftMat.density, r, mat.density, h);
// 		av_max = Math.min(
// 			Formula.rip_vel(shaftMat.strength / shaftMat.density, 0.25),
// 			Formula.rip_vel(mat.strength / mat.density, r)
// 		);
// 	}
// 
// 	@Override
// 	@SideOnly(Side.CLIENT)
// 	protected void addInformation(IBlockState state, List<String> tooltip, ITooltipFlag advanced) {
// 		super.addInformation(state, tooltip, advanced);
// 		tooltip.add(TooltipUtil.format("info.kineng.toolstats", radius(state), maxF));
// 	}
// 
// }


// Path: src/java/cd4017be/kineng/tileentity/ManualPower.java
import static net.minecraft.util.EnumFacing.AxisDirection.POSITIVE;
import java.util.*;
import cd4017be.kineng.block.BlockRotaryTool;
import cd4017be.kineng.physics.*;
import cd4017be.lib.block.AdvancedBlock.IInteractiveTile;
import cd4017be.lib.block.AdvancedBlock.INeighborAwareTile;
import cd4017be.lib.tileentity.BaseTileEntity.ITickableServerOnly;
import cd4017be.lib.util.TooltipUtil;
import cd4017be.math.cplx.CplxF;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.entity.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.*;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.chunk.Chunk;

				|| Math.abs(px - lh.posX) + Math.abs(pz - lh.posZ) >= 0.25
				|| e.getHealth() < e.getMaxHealth()
			) continue;
			CplxF str = ENTITY_STRENGTH.get(e.getClass());
			if (str == null) continue;
			double F = Math.copySign(str.r, lh.posY - py), dv = v * F / str.i - 0.5;
			dv = Math.max(1.0 - 4.0 * dv * dv, 0);
			if (e instanceof EntityAgeable) {
				EntityAgeable ea = (EntityAgeable)e;
				int age = ea.getGrowingAge();
				if (age < -MAX_TIME) {
					F = 0;
					dv = 0;
				} else {
					if (age > 0) age = 0;
					remT += Math.max(age + MAX_TIME, 0);
				}
				ea.setGrowingAge(age - (int)(CHECK_INTERVAL * (1.0 + dv)));
				n++;
			} else if (rand.nextFloat() < dv)
				e.setHealth(e.getMaxHealth() * 0.5F);
			acc.add(str);
			force.F += F;
		}
		if (force.F != 0)
			force.Fdv = -Math.abs(force.F * acc.r / acc.i);
		if (n > 0) remT /= n;
	}

	@Override

	protected DynamicForce createForce(BlockRotaryTool block) {
