    001package net.minecraftforge.client.model.obj;
    002
    003import java.util.ArrayList;
    004
    005import net.minecraft.client.renderer.Tessellator;
    006import cpw.mods.fml.relauncher.Side;
    007import cpw.mods.fml.relauncher.SideOnly;
    008
    009@SideOnly(Side.CLIENT)
    010public class GroupObject
    011{
    012
    013    public String name;
    014    public ArrayList<Face> faces = new ArrayList<Face>();
    015    public int glDrawingMode;
    016
    017    public GroupObject()
    018    {
    019        this("");
    020    }
    021
    022    public GroupObject(String name)
    023    {
    024        this(name, -1);
    025    }
    026
    027    public GroupObject(String name, int glDrawingMode)
    028    {
    029        this.name = name;
    030        this.glDrawingMode = glDrawingMode;
    031    }
    032
    033    public void render()
    034    {
    035        if (faces.size() > 0)
    036        {
    037            Tessellator tessellator = Tessellator.instance;
    038            tessellator.startDrawing(glDrawingMode);
    039            render(tessellator);
    040            tessellator.draw();
    041        }
    042    }
    043
    044    public void render(Tessellator tessellator)
    045    {
    046        if (faces.size() > 0)
    047        {
    048            for (Face face : faces)
    049            {
    050                face.addFaceForRender(tessellator);
    051            }
    052        }
    053    }
    054}