cn.academy.core.client.render.SkillRenderDebug.java Source code

Java tutorial

Introduction

Here is the source code for cn.academy.core.client.render.SkillRenderDebug.java

Source

/**
 * Copyright (c) Lambda Innovation, 2013-2015
 * ??Lambda Innovation
 * http://www.lambdacraft.cn/
 *
 * AcademyCraft is open-source, and it is distributed under 
 * the terms of GNU General Public License. You can modify
 * and distribute freely as long as you follow the license.
 * AcademyCraft??GNU???
 * ????
 * http://www.gnu.org/licenses/gpl.html
 */
package cn.academy.core.client.render;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;

import org.lwjgl.opengl.GL11;

import cn.academy.api.client.render.SkillRenderer;
import cn.liutils.util.RenderUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

/**
 * @author WeathFolD
 *
 */
public class SkillRenderDebug extends SkillRenderer {

    public static SkillRenderDebug instance = new SkillRenderDebug();

    private SkillRenderDebug() {
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void renderHandEffect(EntityPlayer player, HandRenderType type, long time) {
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void renderSurroundings(EntityPlayer player, long time) {
        GL11.glPushMatrix();
        {
            GL11.glTranslated(-.5, 0, -.5);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GL11.glColor4f(1, 1, 1, 0.3F);
            RenderUtils.drawCube(1, 1, 2);
            GL11.glDisable(GL11.GL_BLEND);
        }
        GL11.glPopMatrix();
    }

    private static Vec3 vec(double x, double y, double z) {
        return Vec3.createVectorHelper(x, y, z);
    }

}