Package pneumaticCraft.client.model

Source Code of pneumaticCraft.client.model.ModelAirCompressor

package pneumaticCraft.client.model;

import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

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

public class ModelAirCompressor extends BaseModel{

    private final ResourceLocation activeTexture;

    public ModelAirCompressor(){
        super("airCompressor.obj");
        activeTexture = new ResourceLocation(Textures.MODEL_LOCATION + "airCompressorActive.png");
    }

    @Override
    public boolean rotateModelBasedOnBlockMeta(){
        GL11.glRotated(180, 0, 1, 0);
        return true;
    }

    @Override
    public ResourceLocation getModelTexture(TileEntity tile){
        boolean active = false;
        if(tile != null) {
            TileEntityAirCompressor compressor = (TileEntityAirCompressor)tile;
            active = compressor.burnTime > 0;
        }
        return active ? activeTexture : resLoc;
    }
}
TOP

Related Classes of pneumaticCraft.client.model.ModelAirCompressor

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.