rheel.ac.client.renderer.EntityRendererPsychoSlime.java Source code

Java tutorial

Introduction

Here is the source code for rheel.ac.client.renderer.EntityRendererPsychoSlime.java

Source

/*
 * This class belongs to the source code of Advanced Chemistry.
 * It might depend on other Advanced Chemistry classes to work
 * properly.
 * 
 * For the full license, please see the licence.txt in the source
 * directory.
 */
package rheel.ac.client.renderer;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderSlime;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import rheel.ac.common.entity.EntityPsychoSlime;
import rheel.ac.common.entity.EntityPsychoSlime.ColorFields;

/**
 * @Author Rheel
 */
public class EntityRendererPsychoSlime extends RenderSlime {
    public EntityRendererPsychoSlime(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) {
        super(par1ModelBase, par2ModelBase, par3);
    }

    @Override
    protected ResourceLocation getSlimeTextures(EntitySlime par1EntitySlime) {
        if (par1EntitySlime instanceof EntityPsychoSlime) {
            ColorFields color = ((EntityPsychoSlime) par1EntitySlime).getColors();
            GL11.glColor3f(color.getRed(), color.getGreen(), color.getBlue());
        }

        return new ResourceLocation("ac:textures/models/renderers/Slime.png");
    }
}