// Path: src/java/cd4017be/kineng/physics/Ticking.java
// public static final double dt = 0.05;
// 
// Path: src/java/cd4017be/kineng/Main.java
// @Mod(modid = Main.ID, useMetadata = true)
// public class Main {
// 
// 	public static final String ID = "kineng";
// 
// 	@Instance(ID)
// 	public static Main instance;
// 
// 	public static Logger LOG;
// 
// 	@SidedProxy(clientSide = "cd4017be." + ID + ".ClientProxy", serverSide = "cd4017be." + ID + ".CommonProxy")
// 	public static CommonProxy proxy;
// 
// 	public Main() {
// 		RecipeScriptContext.scriptRegistry.add(new Version("kinetic", "/assets/" + ID + "/config/recipes.rcp"));
// 	}
// 
// 	@Mod.EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		LOG = event.getModLog();
// 		proxy.preInit();
// 		StructureLocations.register();
// 		RecipeScriptContext.instance.run("kinetic.PRE_INIT");
// 	}
// 
// 	@Mod.EventHandler
// 	public void load(FMLInitializationEvent event) {
// 		Objects.init();
// 		proxy.init(new ConfigConstants(RecipeScriptContext.instance.modules.get("kinetic")));
// 	}
// 
// 	@Mod.EventHandler
// 	public void postInit(FMLPostInitializationEvent event) {
// 		Ticking.init();
// 	}
// 
// 	@Mod.EventHandler
// 	public void onShutdown(FMLServerStoppingEvent event) {
// 		Ticking.clear();
// 	}
// 
// }


import static cd4017be.kineng.physics.Ticking.dt;
import static cd4017be.lib.network.Sync.GUI;
import cd4017be.kineng.Main;
import cd4017be.kineng.physics.*;
import cd4017be.lib.Gui.AdvancedContainer;
import cd4017be.lib.Gui.AdvancedContainer.IStateInteractionHandler;
import cd4017be.lib.Gui.ModularGui;
import cd4017be.lib.Gui.comp.*;
import cd4017be.lib.network.*;
import cd4017be.math.cplx.CplxD;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.*;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

	@Sync public void mode(byte mode) {
		if (mode == this.mode) return;
		this.mode = mode;
		if (world != null && world.isRemote) return;
		switch(mode) {
		case A_CONST_PWR:
			con.link(new ConstPower());
			break;
		case A_CONST_VEL:
			con.link(new ConstSpeed());
			break;
		case A_FRICTION:
			con.link(new Friction());
			break;
		default:
			con.link(null);
		}
	}

	@Override
	public double setShaft(ShaftAxis shaft) {
		con.setShaft(shaft);
		return super.setShaft(shaft);
	}

	@Override
	public AdvancedContainer getContainer(EntityPlayer player, int id) {
		return new AdvancedContainer(this, StateSyncAdv.of(false, this), player);
	}


// Path: src/java/cd4017be/kineng/physics/Ticking.java
// public static final double dt = 0.05;
// 
// Path: src/java/cd4017be/kineng/Main.java
// @Mod(modid = Main.ID, useMetadata = true)
// public class Main {
// 
// 	public static final String ID = "kineng";
// 
// 	@Instance(ID)
// 	public static Main instance;
// 
// 	public static Logger LOG;
// 
// 	@SidedProxy(clientSide = "cd4017be." + ID + ".ClientProxy", serverSide = "cd4017be." + ID + ".CommonProxy")
// 	public static CommonProxy proxy;
// 
// 	public Main() {
// 		RecipeScriptContext.scriptRegistry.add(new Version("kinetic", "/assets/" + ID + "/config/recipes.rcp"));
// 	}
// 
// 	@Mod.EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		LOG = event.getModLog();
// 		proxy.preInit();
// 		StructureLocations.register();
// 		RecipeScriptContext.instance.run("kinetic.PRE_INIT");
// 	}
// 
// 	@Mod.EventHandler
// 	public void load(FMLInitializationEvent event) {
// 		Objects.init();
// 		proxy.init(new ConfigConstants(RecipeScriptContext.instance.modules.get("kinetic")));
// 	}
// 
// 	@Mod.EventHandler
// 	public void postInit(FMLPostInitializationEvent event) {
// 		Ticking.init();
// 	}
// 
// 	@Mod.EventHandler
// 	public void onShutdown(FMLServerStoppingEvent event) {
// 		Ticking.clear();
// 	}
// 
// }


// Path: src/java/cd4017be/kineng/tileentity/MechanicalDebug.java
import static cd4017be.kineng.physics.Ticking.dt;
import static cd4017be.lib.network.Sync.GUI;
import cd4017be.kineng.Main;
import cd4017be.kineng.physics.*;
import cd4017be.lib.Gui.AdvancedContainer;
import cd4017be.lib.Gui.AdvancedContainer.IStateInteractionHandler;
import cd4017be.lib.Gui.ModularGui;
import cd4017be.lib.Gui.comp.*;
import cd4017be.lib.network.*;
import cd4017be.math.cplx.CplxD;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.*;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

	@Sync public void mode(byte mode) {
		if (mode == this.mode) return;
		this.mode = mode;
		if (world != null && world.isRemote) return;
		switch(mode) {
		case A_CONST_PWR:
			con.link(new ConstPower());
			break;
		case A_CONST_VEL:
			con.link(new ConstSpeed());
			break;
		case A_FRICTION:
			con.link(new Friction());
			break;
		default:
			con.link(null);
		}
	}

	@Override
	public double setShaft(ShaftAxis shaft) {
		con.setShaft(shaft);
		return super.setShaft(shaft);
	}

	@Override
	public AdvancedContainer getContainer(EntityPlayer player, int id) {
		return new AdvancedContainer(this, StateSyncAdv.of(false, this), player);
	}


	private static final ResourceLocation GUI_TEX = new ResourceLocation(Main.ID, "textures/gui/debug.png");
