@SubscribeEvent
public void render(RenderWorldLastEvent event)
{
EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
PlayerInfoClient info = ForgeEssentialsClient.info;
if (player == null || info == null || info.getPoint1() == null && info.getPoint2() == null)
// OutputHandler.devdebug("NOT RENDERRING");
{
return;
}
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
Tessellator tess = Tessellator.instance;
Tessellator.renderingWorldRenderer = false;
// GL11.glLineWidth(20f);
boolean render1 = false;
// render p1
if (info.getPoint1() != null)
{
ClientPoint p1 = info.getPoint1();
GL11.glTranslated(p1.x - RenderManager.renderPosX, p1.y + 1 - RenderManager.renderPosY, p1.z - RenderManager.renderPosZ);
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glColor3f(255, 0, 0);
renderBlockBox(tess);
render1 = true;
}
// render p2
if (info.getPoint2() != null)
{
ClientPoint p1 = info.getPoint1();
ClientPoint p2 = info.getPoint2();
if (render1)
{
float x = p2.getX() - p1.getX();
float y = (float) (p1.getY() - p2.getY()) + 1;
float z = (float) (p1.getZ() - p2.getZ()) - 1;
GL11.glTranslated(x, y, z);
}
else
{
GL11.glTranslated(p2.x - RenderManager.renderPosX, p2.y + 1 - RenderManager.renderPosY, p2.z - RenderManager.renderPosZ);
}
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glColor3f(0, 255, 0);
renderBlockBox(tess);
}
if (info.getSelection() != null)
{
ClientSelection sel = info.getSelection();
float x = sel.getLowPoint().getX() - sel.getEnd().getX();
float y = sel.getLowPoint().getY() - sel.getEnd().getY();
float z = (float) (sel.getLowPoint().getZ() - sel.getEnd().getZ()) - 1;