cn.lambdacraft.mob.client.renderer.RenderHoundeye.java Source code

Java tutorial

Introduction

Here is the source code for cn.lambdacraft.mob.client.renderer.RenderHoundeye.java

Source

/** 
 * Copyright (c) LambdaCraft Modding Team, 2013
 * ??LambdaCraft ? 2013.
 * http://lambdacraft.half-life.cn/
 * 
 * LambdaCraft is open-source. It is distributed under the terms of the
 * LambdaCraft Open Source License. It grants rights to read, modify, compile
 * or run the code. It does *NOT* grant the right to redistribute this software
 * or its modifications in any form, binary or source, except if expressively
 * granted by the copyright holder.
 *
 * LambdaCraft???LambdaCraft??????
 * ?? ??????????
 */
package cn.lambdacraft.mob.client.renderer;

import java.util.Random;

import net.minecraft.entity.EntityLiving;

import org.lwjgl.opengl.GL11;

import cn.lambdacraft.mob.client.model.ModelHoundeye;
import cn.lambdacraft.mob.entity.EntityHoundeye;
import cn.liutils.api.client.render.LIRenderMob;

/**
 * @author WeAthFolD
 *
 */
public class RenderHoundeye extends LIRenderMob {

    protected static ModelHoundeye model = new ModelHoundeye();
    protected Random rand = new Random();

    /**
     * @param par1ModelBase
     * @param par2
     */
    public RenderHoundeye() {
        super(model, 0.5F);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void func_110827_b(EntityLiving ent, double par2, double par4, double par6, float par8, float par9) {
        GL11.glPushMatrix();
        float yOffset = ent.prevLimbSwingAmount + (ent.limbSwingAmount - ent.prevLimbSwingAmount) * par9;
        float xOffset = 0.0F, zOffset = 0.0F;
        if (((EntityHoundeye) ent).isCharging) {
            xOffset = rand.nextFloat() * 0.3F;
            zOffset = rand.nextFloat() * 0.3F;
            yOffset += rand.nextFloat() * 0.3F;
        }
        if (yOffset > 1.0F)
            yOffset = 1.0F;
        yOffset *= 0.2F;
        GL11.glTranslatef(xOffset, yOffset, zOffset);
        super.func_110827_b(ent, par2, par4, par6, par8, par9);
        GL11.glPopMatrix();
    }

}