// Path: src/main/java/com/github/worldsender/mcanm/common/exceptions/ModelFormatException.java
// public class ModelFormatException extends IllegalArgumentException {
// 	/**
// 	 *
// 	 */
// 	private static final long serialVersionUID = -4000239134878464297L;
// 
// 	public ModelFormatException() {
// 		super();
// 	}
// 
// 	public ModelFormatException(String message) {
// 		super(message);
// 	}
// 
// 	public ModelFormatException(Throwable cause) {
// 		super(cause);
// 	}
// 
// 	public ModelFormatException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.lwjgl.util.vector.Vector2f;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;
package com.github.worldsender.mcanm.common.animation.parts;




public class AnimatedValue {
	public static class AnimatedValueBuilder {
		private AnimatedValue value = null;

		private void checkAvailable() {
			value = new AnimatedValue(0.0f);
		}

		public AnimatedValueBuilder addSpline(Spline spline) {
			value.splines.add(spline);
			return this;
		}

		public AnimatedValueBuilder fromStream(DataInputStream dis) throws IOException, ModelFormatException {
			if (value == null) {
				throw new IllegalStateException("Can only red from stream with after a default value has been set");
			}
			int nbrFrames = dis.readUnsignedShort();
			if (nbrFrames == 0) {
				Vector2f point = new Vector2f(0, value.defaultValue);
				value.splines.add(Spline.easeIn(Spline.EASE_IN_CONST, point, dis));
				value.splines.add(Spline.easeOut(Spline.EASE_OUT_CONST, point, dis));
			} else {
				Vector2f left = null;
				Vector2f right = Spline.readPoint(dis);
				byte easeIn = dis.readByte();
// Path: src/main/java/com/github/worldsender/mcanm/common/exceptions/ModelFormatException.java
// public class ModelFormatException extends IllegalArgumentException {
// 	/**
// 	 *
// 	 */
// 	private static final long serialVersionUID = -4000239134878464297L;
// 
// 	public ModelFormatException() {
// 		super();
// 	}
// 
// 	public ModelFormatException(String message) {
// 		super(message);
// 	}
// 
// 	public ModelFormatException(Throwable cause) {
// 		super(cause);
// 	}
// 
// 	public ModelFormatException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


// Path: src/main/java/com/github/worldsender/mcanm/common/animation/parts/AnimatedValue.java
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.lwjgl.util.vector.Vector2f;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;

package com.github.worldsender.mcanm.common.animation.parts;




public class AnimatedValue {
	public static class AnimatedValueBuilder {
		private AnimatedValue value = null;

		private void checkAvailable() {
			value = new AnimatedValue(0.0f);
		}

		public AnimatedValueBuilder addSpline(Spline spline) {
			value.splines.add(spline);
			return this;
		}

		public AnimatedValueBuilder fromStream(DataInputStream dis) throws IOException, ModelFormatException {
			if (value == null) {
				throw new IllegalStateException("Can only red from stream with after a default value has been set");
			}
			int nbrFrames = dis.readUnsignedShort();
			if (nbrFrames == 0) {
				Vector2f point = new Vector2f(0, value.defaultValue);
				value.splines.add(Spline.easeIn(Spline.EASE_IN_CONST, point, dis));
				value.splines.add(Spline.easeOut(Spline.EASE_OUT_CONST, point, dis));
			} else {
				Vector2f left = null;
				Vector2f right = Spline.readPoint(dis);
				byte easeIn = dis.readByte();
				value.splines.add(Spline.easeIn(easeIn, right, dis));