Skip to content

Instantly share code, notes, and snippets.

@tehbeard
Created July 14, 2013 04:08
Show Gist options
  • Save tehbeard/5993181 to your computer and use it in GitHub Desktop.
Save tehbeard/5993181 to your computer and use it in GitHub Desktop.
package com.tehbeard.forge.schematic.shell;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.ForgeSubscribe;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class RenderBox{
@ForgeSubscribe
public void renderWorldLastEvent(RenderWorldLastEvent evt)
{
Minecraft mc = FMLClientHandler.instance().getClient();
double doubleX = mc.thePlayer.posX - 0.5;
double doubleY = mc.thePlayer.posY + 0.1;
double doubleZ = mc.thePlayer.posZ - 0.5;
GL11.glPushMatrix();
GL11.glTranslated(-doubleX, -doubleY, -doubleZ);
GL11.glColor3ub((byte)255,(byte)0,(byte)0);
GL11.glLineWidth(5.0f);
float mx = 8.5f;
float my = 9;
float mz = 8.5f;
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex3f(mx,my,mz);
GL11.glVertex3f(mx+1,my,mz);
GL11.glVertex3f(mx+1,my,mz+1);
GL11.glVertex3f(mx,my,mz+1);
GL11.glVertex3f(mx,my,mz);
GL11.glEnd();
GL11.glPopMatrix();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment