// Path: src/java/cd4017be/kineng/physics/Ticking.java
// public static final double dt = 0.05;
// 
// 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 cd4017be.kineng.physics.Ticking.dt;
import static java.lang.Math.*;
import static net.minecraftforge.fluids.FluidRegistry.WATER;
import cd4017be.kineng.block.BlockRotaryTool;
import cd4017be.kineng.physics.*;
import cd4017be.lib.block.AdvancedBlock.IInteractiveTile;
import cd4017be.math.cplx.CplxD;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fluids.*;

package cd4017be.kineng.tileentity;


/** 
 * @author CD4017BE */
public class WaterWheel extends KineticMachine implements IWaterWheel, IInteractiveTile {

	public static boolean WATER_ONLY = true;

	double vsq;

	@Override
	public double passLiquid(double vsq, FluidStack liquid, EnumFacing dir) {
		if (con == null || dir.getAxis() == axis()) return vsq;
		if (WATER_ONLY && liquid.getFluid() != WATER) return vsq;
		Wheel wheel = getForce();
		int d = dir.ordinal();
		wheel.add(
			liquid.amount * liquid.getFluid().getDensity(liquid) * 0.001,
			copySign(vsq, ((d ^ d << 1) & 2) - 1)
		);
		return min(wheel.vsq, vsq);
	}

	@Override

// Path: src/java/cd4017be/kineng/physics/Ticking.java
// public static final double dt = 0.05;
// 
// 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/WaterWheel.java
import static cd4017be.kineng.physics.Ticking.dt;
import static java.lang.Math.*;
import static net.minecraftforge.fluids.FluidRegistry.WATER;
import cd4017be.kineng.block.BlockRotaryTool;
import cd4017be.kineng.physics.*;
import cd4017be.lib.block.AdvancedBlock.IInteractiveTile;
import cd4017be.math.cplx.CplxD;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fluids.*;

package cd4017be.kineng.tileentity;


/** 
 * @author CD4017BE */
public class WaterWheel extends KineticMachine implements IWaterWheel, IInteractiveTile {

	public static boolean WATER_ONLY = true;

	double vsq;

	@Override
	public double passLiquid(double vsq, FluidStack liquid, EnumFacing dir) {
		if (con == null || dir.getAxis() == axis()) return vsq;
		if (WATER_ONLY && liquid.getFluid() != WATER) return vsq;
		Wheel wheel = getForce();
		int d = dir.ordinal();
		wheel.add(
			liquid.amount * liquid.getFluid().getDensity(liquid) * 0.001,
			copySign(vsq, ((d ^ d << 1) & 2) - 1)
		);
		return min(wheel.vsq, vsq);
	}

	@Override

	protected DynamicForce createForce(BlockRotaryTool block) {
