Package pneumaticCraft.client.model

Source Code of pneumaticCraft.client.model.ModelElevatorBase

// Date: 20-12-2013 15:09:04
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX

package pneumaticCraft.client.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;

import org.lwjgl.opengl.GL11;

import pneumaticCraft.common.tileentity.TileEntityElevatorBase;
import pneumaticCraft.lib.Textures;

public class ModelElevatorBase extends ModelBase implements IBaseModel{
    //fields
    ModelRenderer Base;
    ModelRenderer Pole1;
    ModelRenderer Pole2;
    ModelRenderer Pole3;
    ModelRenderer Pole4;
    ModelRenderer Floor;
    ModelRenderer Pole5;
    ModelRenderer TopSupport1;
    ModelRenderer TopSupport2;
    ModelRenderer TopSupport3;
    ModelRenderer TopSupport4;
    ModelRenderer Support1;
    ModelRenderer Support2;
    ModelRenderer Support3;
    ModelRenderer Support4;
    ModelRenderer Support5;
    ModelRenderer Support6;
    ModelRenderer Support7;
    ModelRenderer Support8;
    ModelRenderer PipeLeft1;
    ModelRenderer PipeLeft2;
    ModelRenderer PipeLeft3;
    ModelRenderer PipeLeft4;
    ModelRenderer PipeRight1;
    ModelRenderer PipeRight2;
    ModelRenderer PipeRight3;
    ModelRenderer PipeRight4;
    ModelRenderer PipeFront1;
    ModelRenderer PipeFront2;
    ModelRenderer PipeFront3;
    ModelRenderer PipeFront4;
    ModelRenderer PipeBack1;
    ModelRenderer PipeBack2;
    ModelRenderer PipeBack3;
    ModelRenderer PipeBack4;

    public ModelElevatorBase(){
        textureWidth = 64;
        textureHeight = 64;

        Base = new ModelRenderer(this, 0, 0);
        Base.addBox(0F, 0F, 0F, 16, 1, 16);
        Base.setRotationPoint(-8F, 23F, -8F);
        Base.setTextureSize(64, 64);
        Base.mirror = true;
        setRotation(Base, 0F, 0F, 0F);
        Pole1 = new ModelRenderer(this, 0, 17);
        Pole1.addBox(0F, 0F, 0F, 2, 14, 2);
        Pole1.setRotationPoint(-1F, 9F, -1F);
        Pole1.setTextureSize(64, 64);
        Pole1.mirror = true;
        setRotation(Pole1, 0F, 0F, 0F);
        Pole2 = new ModelRenderer(this, 0, 17);
        Pole2.addBox(0F, 0F, 0F, 4, 14, 4);
        Pole2.setRotationPoint(-2F, 9F, -2F);
        Pole2.setTextureSize(64, 64);
        Pole2.mirror = true;
        setRotation(Pole2, 0F, 0F, 0F);
        Pole3 = new ModelRenderer(this, 0, 17);
        Pole3.addBox(0F, 0F, 0F, 6, 14, 6);
        Pole3.setRotationPoint(-3F, 9F, -3F);
        Pole3.setTextureSize(64, 64);
        Pole3.mirror = true;
        setRotation(Pole3, 0F, 0F, 0F);
        Pole4 = new ModelRenderer(this, 0, 17);
        Pole4.addBox(0F, 0F, 0F, 8, 14, 8);
        Pole4.setRotationPoint(-4F, 9F, -4F);
        Pole4.setTextureSize(64, 64);
        Pole4.mirror = true;
        setRotation(Pole4, 0F, 0F, 0F);
        Floor = new ModelRenderer(this, 0, 0);
        Floor.addBox(0F, 0F, 0F, 16, 1, 16);
        Floor.setRotationPoint(-8F, 8F, -8F);
        Floor.setTextureSize(64, 64);
        Floor.mirror = true;
        setRotation(Floor, 0F, 0F, 0F);
        Pole5 = new ModelRenderer(this, 0, 17);
        Pole5.addBox(0F, 0F, 0F, 10, 14, 10);
        Pole5.setRotationPoint(-5F, 9F, -5F);
        Pole5.setTextureSize(64, 64);
        Pole5.mirror = true;
        setRotation(Pole5, 0F, 0F, 0F);
        TopSupport1 = new ModelRenderer(this, 0, 0);
        TopSupport1.addBox(0F, 0F, 0F, 2, 1, 16);
        TopSupport1.setRotationPoint(6F, 9F, -8F);
        TopSupport1.setTextureSize(64, 64);
        TopSupport1.mirror = true;
        setRotation(TopSupport1, 0F, 0F, 0F);
        TopSupport2 = new ModelRenderer(this, 0, 0);
        TopSupport2.addBox(0F, 0F, 0F, 2, 1, 16);
        TopSupport2.setRotationPoint(-8F, 9F, -8F);
        TopSupport2.setTextureSize(64, 64);
        TopSupport2.mirror = true;
        setRotation(TopSupport2, 0F, 0F, 0F);
        TopSupport3 = new ModelRenderer(this, 0, 57);
        TopSupport3.addBox(0F, 0F, 0F, 12, 1, 2);
        TopSupport3.setRotationPoint(-6F, 9F, -8F);
        TopSupport3.setTextureSize(64, 64);
        TopSupport3.mirror = true;
        setRotation(TopSupport3, 0F, 0F, 0F);
        TopSupport4 = new ModelRenderer(this, 0, 57);
        TopSupport4.addBox(0F, 0F, 0F, 12, 1, 2);
        TopSupport4.setRotationPoint(-6F, 9F, 6F);
        TopSupport4.setTextureSize(64, 64);
        TopSupport4.mirror = true;
        setRotation(TopSupport4, 0F, 0F, 0F);
        Support1 = new ModelRenderer(this, 40, 17);
        Support1.addBox(0F, 0F, 0F, 1, 15, 1);
        Support1.setRotationPoint(6.8F, 9F, -1F);
        Support1.setTextureSize(64, 64);
        Support1.mirror = true;
        setRotation(Support1, -0.3490659F, 0F, 0F);
        Support2 = new ModelRenderer(this, 40, 17);
        Support2.addBox(0F, 0F, 0F, 1, 15, 1);
        Support2.setRotationPoint(-7F, 9F, -1F);
        Support2.setTextureSize(64, 64);
        Support2.mirror = true;
        setRotation(Support2, -0.3490659F, 0F, 0F);
        Support3 = new ModelRenderer(this, 40, 17);
        Support3.addBox(0F, 0F, 0F, 1, 15, 1);
        Support3.setRotationPoint(6F, 9.8F, 0.3F);
        Support3.setTextureSize(64, 64);
        Support3.mirror = true;
        setRotation(Support3, 0.3490659F, 0F, 0F);
        Support4 = new ModelRenderer(this, 40, 17);
        Support4.addBox(0F, 0F, 0F, 1, 15, 1);
        Support4.setRotationPoint(-7.8F, 9.8F, 0.3F);
        Support4.setTextureSize(64, 64);
        Support4.mirror = true;
        setRotation(Support4, 0.3490659F, 0F, 0F);
        Support5 = new ModelRenderer(this, 40, 17);
        Support5.addBox(0F, 0F, 0F, 1, 15, 1);
        Support5.setRotationPoint(0.3F, 9.8F, 6.8F);
        Support5.setTextureSize(64, 64);
        Support5.mirror = true;
        setRotation(Support5, 0F, 0F, -0.3490659F);
        Support6 = new ModelRenderer(this, 40, 17);
        Support6.addBox(0F, 0F, 0F, 1, 15, 1);
        Support6.setRotationPoint(0.3F, 9.8F, -7F);
        Support6.setTextureSize(64, 64);
        Support6.mirror = true;
        setRotation(Support6, 0F, 0F, -0.3490659F);
        Support7 = new ModelRenderer(this, 40, 17);
        Support7.addBox(0F, 0F, 0F, 1, 15, 1);
        Support7.setRotationPoint(-1F, 9F, 6F);
        Support7.setTextureSize(64, 64);
        Support7.mirror = true;
        setRotation(Support7, 0F, 0F, 0.3490659F);
        Support8 = new ModelRenderer(this, 40, 17);
        Support8.addBox(0F, 0F, 0F, 1, 15, 1);
        Support8.setRotationPoint(-1F, 9F, -7.8F);
        Support8.setTextureSize(64, 64);
        Support8.mirror = true;
        setRotation(Support8, 0F, 0F, 0.3490659F);
        PipeLeft1 = new ModelRenderer(this, 54, 17);
        PipeLeft1.addBox(0F, 0F, 0F, 3, 1, 2);
        PipeLeft1.setRotationPoint(5F, 17F, -1F);
        PipeLeft1.setTextureSize(64, 64);
        PipeLeft1.mirror = true;
        setRotation(PipeLeft1, 0F, 0F, 0F);
        PipeLeft2 = new ModelRenderer(this, 54, 17);
        PipeLeft2.addBox(0F, 0F, 0F, 3, 1, 2);
        PipeLeft2.setRotationPoint(5F, 14F, -1F);
        PipeLeft2.setTextureSize(64, 64);
        PipeLeft2.mirror = true;
        setRotation(PipeLeft2, 0F, 0F, 0F);
        PipeLeft3 = new ModelRenderer(this, 54, 17);
        PipeLeft3.addBox(0F, 0F, 0F, 3, 2, 1);
        PipeLeft3.setRotationPoint(5F, 15F, -2F);
        PipeLeft3.setTextureSize(64, 64);
        PipeLeft3.mirror = true;
        setRotation(PipeLeft3, 0F, 0F, 0F);
        PipeLeft4 = new ModelRenderer(this, 54, 17);
        PipeLeft4.addBox(0F, 0F, 0F, 3, 2, 1);
        PipeLeft4.setRotationPoint(5F, 15F, 1F);
        PipeLeft4.setTextureSize(64, 64);
        PipeLeft4.mirror = true;
        setRotation(PipeLeft4, 0F, 0F, 0F);
        PipeRight1 = new ModelRenderer(this, 54, 17);
        PipeRight1.addBox(0F, 0F, 0F, 3, 1, 2);
        PipeRight1.setRotationPoint(-8F, 14F, -1F);
        PipeRight1.setTextureSize(64, 64);
        PipeRight1.mirror = true;
        setRotation(PipeRight1, 0F, 0F, 0F);
        PipeRight2 = new ModelRenderer(this, 54, 17);
        PipeRight2.addBox(0F, 0F, 0F, 3, 2, 1);
        PipeRight2.setRotationPoint(-8F, 15F, 1F);
        PipeRight2.setTextureSize(64, 64);
        PipeRight2.mirror = true;
        setRotation(PipeRight2, 0F, 0F, 0F);
        PipeRight3 = new ModelRenderer(this, 54, 17);
        PipeRight3.addBox(0F, 0F, 0F, 3, 1, 2);
        PipeRight3.setRotationPoint(-8F, 17F, -1F);
        PipeRight3.setTextureSize(64, 64);
        PipeRight3.mirror = true;
        setRotation(PipeRight3, 0F, 0F, 0F);
        PipeRight4 = new ModelRenderer(this, 54, 17);
        PipeRight4.addBox(0F, 0F, 0F, 3, 2, 1);
        PipeRight4.setRotationPoint(-8F, 15F, -2F);
        PipeRight4.setTextureSize(64, 64);
        PipeRight4.mirror = true;
        setRotation(PipeRight4, 0F, 0F, 0F);
        PipeFront1 = new ModelRenderer(this, 54, 17);
        PipeFront1.addBox(0F, 0F, 0F, 2, 1, 3);
        PipeFront1.setRotationPoint(-1F, 14F, -8F);
        PipeFront1.setTextureSize(64, 64);
        PipeFront1.mirror = true;
        setRotation(PipeFront1, 0F, 0F, 0F);
        PipeFront2 = new ModelRenderer(this, 54, 17);
        PipeFront2.addBox(0F, 0F, 0F, 2, 1, 3);
        PipeFront2.setRotationPoint(-1F, 17F, -8F);
        PipeFront2.setTextureSize(64, 64);
        PipeFront2.mirror = true;
        setRotation(PipeFront2, 0F, 0F, 0F);
        PipeFront3 = new ModelRenderer(this, 56, 17);
        PipeFront3.addBox(0F, 0F, 0F, 1, 2, 3);
        PipeFront3.setRotationPoint(-2F, 15F, -8F);
        PipeFront3.setTextureSize(64, 64);
        PipeFront3.mirror = true;
        setRotation(PipeFront3, 0F, 0F, 0F);
        PipeFront4 = new ModelRenderer(this, 56, 17);
        PipeFront4.addBox(0F, 0F, 0F, 1, 2, 3);
        PipeFront4.setRotationPoint(1F, 15F, -8F);
        PipeFront4.setTextureSize(64, 64);
        PipeFront4.mirror = true;
        setRotation(PipeFront4, 0F, 0F, 0F);
        PipeBack1 = new ModelRenderer(this, 54, 17);
        PipeBack1.addBox(0F, 0F, 0F, 2, 1, 3);
        PipeBack1.setRotationPoint(-1F, 14F, 5F);
        PipeBack1.setTextureSize(64, 64);
        PipeBack1.mirror = true;
        setRotation(PipeBack1, 0F, 0F, 0F);
        PipeBack2 = new ModelRenderer(this, 54, 17);
        PipeBack2.addBox(0F, 0F, 0F, 2, 1, 3);
        PipeBack2.setRotationPoint(-1F, 17F, 5F);
        PipeBack2.setTextureSize(64, 64);
        PipeBack2.mirror = true;
        setRotation(PipeBack2, 0F, 0F, 0F);
        PipeBack3 = new ModelRenderer(this, 56, 17);
        PipeBack3.addBox(0F, 0F, 0F, 1, 2, 3);
        PipeBack3.setRotationPoint(1F, 15F, 5F);
        PipeBack3.setTextureSize(64, 64);
        PipeBack3.mirror = true;
        setRotation(PipeBack3, 0F, 0F, 0F);
        PipeBack4 = new ModelRenderer(this, 56, 17);
        PipeBack4.addBox(0F, 0F, 0F, 1, 2, 3);
        PipeBack4.setRotationPoint(-2F, 15F, 5F);
        PipeBack4.setTextureSize(64, 64);
        PipeBack4.mirror = true;
        setRotation(PipeBack4, 0F, 0F, 0F);
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){
        super.render(entity, f, f1, f2, f3, f4, f5);
        setRotationAngles(f, f1, f2, f3, f4, f5, entity);
        Base.render(f5);
        Pole1.render(f5);
        Pole2.render(f5);
        Pole3.render(f5);
        Pole4.render(f5);
        Floor.render(f5);
        Pole5.render(f5);
        TopSupport1.render(f5);
        TopSupport2.render(f5);
        TopSupport3.render(f5);
        TopSupport4.render(f5);
        Support1.render(f5);
        Support2.render(f5);
        Support3.render(f5);
        Support4.render(f5);
        Support5.render(f5);
        Support6.render(f5);
        Support7.render(f5);
        Support8.render(f5);
        PipeLeft1.render(f5);
        PipeLeft2.render(f5);
        PipeLeft3.render(f5);
        PipeLeft4.render(f5);
        PipeRight1.render(f5);
        PipeRight2.render(f5);
        PipeRight3.render(f5);
        PipeRight4.render(f5);
        PipeFront1.render(f5);
        PipeFront2.render(f5);
        PipeFront3.render(f5);
        PipeFront4.render(f5);
        PipeBack1.render(f5);
        PipeBack2.render(f5);
        PipeBack3.render(f5);
        PipeBack4.render(f5);
    }

    public void renderModel(float size, float extension, boolean[] sidesConnected){
        Base.render(size);
        Pole5.render(size);
        TopSupport1.render(size);
        TopSupport2.render(size);
        TopSupport3.render(size);
        TopSupport4.render(size);
        Support1.render(size);
        Support2.render(size);
        Support3.render(size);
        Support4.render(size);
        Support5.render(size);
        Support6.render(size);
        Support7.render(size);
        Support8.render(size);
        if(sidesConnected[ForgeDirection.EAST.ordinal()]) {
            PipeLeft1.render(size);
            PipeLeft2.render(size);
            PipeLeft3.render(size);
            PipeLeft4.render(size);
        }
        if(sidesConnected[ForgeDirection.WEST.ordinal()]) {
            PipeRight1.render(size);
            PipeRight2.render(size);
            PipeRight3.render(size);
            PipeRight4.render(size);
        }
        if(sidesConnected[ForgeDirection.SOUTH.ordinal()]) {
            PipeFront1.render(size);
            PipeFront2.render(size);
            PipeFront3.render(size);
            PipeFront4.render(size);
        }
        if(sidesConnected[ForgeDirection.NORTH.ordinal()]) {
            PipeBack1.render(size);
            PipeBack2.render(size);
            PipeBack3.render(size);
            PipeBack4.render(size);
        }

        float factor = 9F / 16;
        GL11.glTranslated(0, -extension / 4, 0);

        GL11.glPushMatrix();
        GL11.glTranslated(0, factor, 0);
        GL11.glScaled(1, extension * 16 / 14 / 4, 1);
        GL11.glTranslated(0, -factor, 0);
        Pole4.render(size);
        GL11.glPopMatrix();

        GL11.glTranslated(0, -extension / 4, 0);

        GL11.glPushMatrix();
        GL11.glTranslated(0, factor, 0);
        GL11.glScaled(1, extension * 16 / 14 / 4, 1);
        GL11.glTranslated(0, -factor, 0);
        Pole3.render(size);
        GL11.glPopMatrix();

        GL11.glTranslated(0, -extension / 4, 0);

        GL11.glPushMatrix();
        GL11.glTranslated(0, factor, 0);
        GL11.glScaled(1, extension * 16 / 14 / 4, 1);
        GL11.glTranslated(0, -factor, 0);
        Pole2.render(size);
        GL11.glPopMatrix();

        GL11.glTranslated(0, -extension / 4, 0);

        GL11.glPushMatrix();
        GL11.glTranslated(0, factor, 0);
        GL11.glScaled(1, extension * 16 / 14 / 4, 1);
        GL11.glTranslated(0, -factor, 0);
        Pole1.render(size);
        GL11.glPopMatrix();

        Floor.render(size);
    }

    private void setRotation(ModelRenderer model, float x, float y, float z){
        model.rotateAngleX = x;
        model.rotateAngleY = y;
        model.rotateAngleZ = z;
    }

    @Override
    public void renderStatic(float size, TileEntity te){

    }

    @Override
    public ResourceLocation getModelTexture(TileEntity tile){
        return Textures.MODEL_ELEVATOR;
    }

    @Override
    public boolean rotateModelBasedOnBlockMeta(){
        return false;
    }

    @Override
    public void renderDynamic(float size, TileEntity te, float partialTicks){
        if(te instanceof TileEntityElevatorBase) {
            TileEntityElevatorBase tile = (TileEntityElevatorBase)te;
            renderModel(1 / 16F, tile.oldExtension + (tile.extension - tile.oldExtension) * partialTicks, tile.sidesConnected);
        } else {
            renderModel(1 / 16F, 0, new boolean[]{false, false, false, false, false, false});
        }
    }

}
TOP

Related Classes of pneumaticCraft.client.model.ModelElevatorBase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.