// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/stored/parts/Material.java
// public class Material {
// 	public String resLocationRaw;
// 
// 	public static Material readFrom(DataInputStream di) throws IOException {
// 		Material tex = new Material();
// 		tex.resLocationRaw = Utils.readString(di);
// 		return tex;
// 	}
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/stored/parts/ModelPartV2.java
// public class ModelPartV2 {
// 	public String name;
// 	/** All available {@link TesselationPoint}s in this part of the model */
// 	public TesselationPoint[] points;
// 	/**
// 	 * The array to store the order of the {@link TesselationPoint}s. To be interpreted as unsigned.
// 	 */
// 	public short[] indices;
// 	/** The materialIndex index part of the model uses (unsigned byte) */
// 	public int materialIndex;
// 
// 	public static ModelPartV2 readFrom(DataInputStream dis) throws IOException {
// 		ModelPartV2 data = new ModelPartV2();
// 		int nbrPoints = dis.readUnsignedShort();
// 		int nbrIndices = dis.readUnsignedShort() * 3;
// 		data.points = new TesselationPoint[nbrPoints];
// 		data.indices = new short[nbrIndices];
// 		data.name = Utils.readString(dis);
// 		data.materialIndex = dis.readUnsignedByte();
// 		for (int i = 0; i < nbrPoints; i++) {
// 			data.points[i] = TesselationPoint.readFrom(dis);
// 		}
// 		for (int i = 0; i < nbrIndices; i++) {
// 			data.indices[i] = dis.readShort();
// 		}
// 		return data;
// 	}
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/visitor/IMaterialVisitor.java
// public interface IMaterialVisitor {
// 	void visitTexture(String textureName);
// 
// 	void visitEnd();
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/visitor/IModelVisitor.java
// public interface IModelVisitor {
// 	void visitModelUUID(UUID uuid);
// 
// 	void visitArtist(String artist);
// 
// 	IPartVisitor visitPart(String name);
// 
// 	void visitEnd();
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/visitor/IPartVisitor.java
// public interface IPartVisitor {
// 	void visitTesselationPoint(TesselationPoint point);
// 
// 	default void visitTesselationPoints(Iterable<TesselationPoint> points) {
// 		for (TesselationPoint p : points) {
// 			visitTesselationPoint(p);
// 		}
// 	}
// 
// 	default void visitTesselationPoints(TesselationPoint[] points) {
// 		this.visitTesselationPoints(Arrays.asList(points));
// 	}
// 
// 	/**
// 	 * Visit a face. Parameters are zero-based indices in the order of visitation of the tesselation points. Tesselation
// 	 * points might be visited before or afterwards.
// 	 * 
// 	 * @param tess1
// 	 * @param tess2
// 	 * @param tess3
// 	 */
// 	void visitFace(short tess1, short tess2, short tess3);
// 
// 	/**
// 	 * Visit multiple faces at once.
// 	 * 
// 	 * @param tessOrder
// 	 *            short[]#length must be divisible by 3
// 	 * @see #visitFace(short, short, short)
// 	 */
// 	default void visitFaces(short[] tessOrder) {
// 		if (tessOrder.length % 3 != 0) {
// 			throw new IllegalArgumentException();
// 		}
// 		int maxI = tessOrder.length / 3;
// 		for (int i = 0; i < maxI; i++) {
// 			visitFace(tessOrder[i], tessOrder[i + 1], tessOrder[i + 2]);
// 		}
// 	}
// 
// 	IMaterialVisitor visitTexture();
// 
// 	void visitEnd();
// }
// 
// 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 com.github.worldsender.mcanm.client.mcanmmodel.stored.parts.Material;
import com.github.worldsender.mcanm.client.mcanmmodel.stored.parts.ModelPartV2;
import com.github.worldsender.mcanm.client.mcanmmodel.visitor.IMaterialVisitor;
import com.github.worldsender.mcanm.client.mcanmmodel.visitor.IModelVisitor;
import com.github.worldsender.mcanm.client.mcanmmodel.visitor.IPartVisitor;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;
package com.github.worldsender.mcanm.client.mcanmmodel.stored;



public class RawDataV2 implements IVersionSpecificData {

	private ModelPartV2[] parts;
	private Material[] mats;

	@Override
	public void visitBy(IModelVisitor visitor) {
		for (ModelPartV2 part : parts) {
			IPartVisitor partVisitor = visitor.visitPart(part.name);
			partVisitor.visitTesselationPoints(part.points);
			partVisitor.visitFaces(part.indices);
			{
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/stored/parts/Material.java
// public class Material {
// 	public String resLocationRaw;
// 
// 	public static Material readFrom(DataInputStream di) throws IOException {
// 		Material tex = new Material();
// 		tex.resLocationRaw = Utils.readString(di);
// 		return tex;
// 	}
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/stored/parts/ModelPartV2.java
// public class ModelPartV2 {
// 	public String name;
// 	/** All available {@link TesselationPoint}s in this part of the model */
// 	public TesselationPoint[] points;
// 	/**
// 	 * The array to store the order of the {@link TesselationPoint}s. To be interpreted as unsigned.
// 	 */
// 	public short[] indices;
// 	/** The materialIndex index part of the model uses (unsigned byte) */
// 	public int materialIndex;
// 
// 	public static ModelPartV2 readFrom(DataInputStream dis) throws IOException {
// 		ModelPartV2 data = new ModelPartV2();
// 		int nbrPoints = dis.readUnsignedShort();
// 		int nbrIndices = dis.readUnsignedShort() * 3;
// 		data.points = new TesselationPoint[nbrPoints];
// 		data.indices = new short[nbrIndices];
// 		data.name = Utils.readString(dis);
// 		data.materialIndex = dis.readUnsignedByte();
// 		for (int i = 0; i < nbrPoints; i++) {
// 			data.points[i] = TesselationPoint.readFrom(dis);
// 		}
// 		for (int i = 0; i < nbrIndices; i++) {
// 			data.indices[i] = dis.readShort();
// 		}
// 		return data;
// 	}
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/visitor/IMaterialVisitor.java
// public interface IMaterialVisitor {
// 	void visitTexture(String textureName);
// 
// 	void visitEnd();
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/visitor/IModelVisitor.java
// public interface IModelVisitor {
// 	void visitModelUUID(UUID uuid);
// 
// 	void visitArtist(String artist);
// 
// 	IPartVisitor visitPart(String name);
// 
// 	void visitEnd();
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/client/mcanmmodel/visitor/IPartVisitor.java
// public interface IPartVisitor {
// 	void visitTesselationPoint(TesselationPoint point);
// 
// 	default void visitTesselationPoints(Iterable<TesselationPoint> points) {
// 		for (TesselationPoint p : points) {
// 			visitTesselationPoint(p);
// 		}
// 	}
// 
// 	default void visitTesselationPoints(TesselationPoint[] points) {
// 		this.visitTesselationPoints(Arrays.asList(points));
// 	}
// 
// 	/**
// 	 * Visit a face. Parameters are zero-based indices in the order of visitation of the tesselation points. Tesselation
// 	 * points might be visited before or afterwards.
// 	 * 
// 	 * @param tess1
// 	 * @param tess2
// 	 * @param tess3
// 	 */
// 	void visitFace(short tess1, short tess2, short tess3);
// 
// 	/**
// 	 * Visit multiple faces at once.
// 	 * 
// 	 * @param tessOrder
// 	 *            short[]#length must be divisible by 3
// 	 * @see #visitFace(short, short, short)
// 	 */
// 	default void visitFaces(short[] tessOrder) {
// 		if (tessOrder.length % 3 != 0) {
// 			throw new IllegalArgumentException();
// 		}
// 		int maxI = tessOrder.length / 3;
// 		for (int i = 0; i < maxI; i++) {
// 			visitFace(tessOrder[i], tessOrder[i + 1], tessOrder[i + 2]);
// 		}
// 	}
// 
// 	IMaterialVisitor visitTexture();
// 
// 	void visitEnd();
// }
// 
// 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/client/mcanmmodel/stored/RawDataV2.java
import java.io.DataInputStream;
import java.io.IOException;
import com.github.worldsender.mcanm.client.mcanmmodel.stored.parts.Material;
import com.github.worldsender.mcanm.client.mcanmmodel.stored.parts.ModelPartV2;
import com.github.worldsender.mcanm.client.mcanmmodel.visitor.IMaterialVisitor;
import com.github.worldsender.mcanm.client.mcanmmodel.visitor.IModelVisitor;
import com.github.worldsender.mcanm.client.mcanmmodel.visitor.IPartVisitor;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;

package com.github.worldsender.mcanm.client.mcanmmodel.stored;



public class RawDataV2 implements IVersionSpecificData {

	private ModelPartV2[] parts;
	private Material[] mats;

	@Override
	public void visitBy(IModelVisitor visitor) {
		for (ModelPartV2 part : parts) {
			IPartVisitor partVisitor = visitor.visitPart(part.name);
			partVisitor.visitTesselationPoints(part.points);
			partVisitor.visitFaces(part.indices);
			{
				IMaterialVisitor matVisitor = partVisitor.visitTexture();