Jump to content

Recommended Posts

Posted

I'm trying to draw lines around block but I have a problem.

 

I want to draw lines which could be see through walls, like chest finders in the hacks. (I don't want it for hack :D)

 

I have this code:

@SubscribeEvent
public void onRender(RenderWorldLastEvent e)
{
	EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
	double x = player.lastTickPosX + (player.posX - player.lastTickPosX) * e.partialTicks;
        double y = player.lastTickPosY + (player.posY - player.lastTickPosY) * e.partialTicks;
        double z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * e.partialTicks;
        
        GL11.glPushMatrix();
        GL11.glTranslated(-x, -y, -z);
        
        GL11.glBegin(GL11.GL_LINES);
        
        GL11.glColor4f(0f, 255f, 237f, 0.3f);
        
        float mx = 0 + 0.5F;
        float my = 66 + 0.5F;
        float mz = 0 + 0.5F;
        
        GL11.glVertex3f(mx + 0.5F, my + 0.5F, mz - 0.5F); GL11.glVertex3f(mx + 0.5F, my - 0.5F, mz - 0.5F);
        GL11.glVertex3f(mx + 0.5F, my - 0.5F, mz - 0.5F); GL11.glVertex3f(mx - 0.5F, my - 0.5F, mz - 0.5F);
        GL11.glVertex3f(mx - 0.5F, my - 0.5F, mz - 0.5F); GL11.glVertex3f(mx - 0.5F, my + 0.5F, mz - 0.5F);
        GL11.glVertex3f(mx - 0.5F, my + 0.5F, mz - 0.5F); GL11.glVertex3f(mx + 0.5F, my + 0.5F, mz - 0.5F);
        
        GL11.glVertex3f(mx + 0.5F, my + 0.5F, mz + 0.5F); GL11.glVertex3f(mx + 0.5F, my - 0.5F, mz + 0.5F);
        GL11.glVertex3f(mx + 0.5F, my - 0.5F, mz + 0.5F); GL11.glVertex3f(mx - 0.5F, my - 0.5F, mz + 0.5F);
        GL11.glVertex3f(mx - 0.5F, my - 0.5F, mz + 0.5F); GL11.glVertex3f(mx - 0.5F, my + 0.5F, mz + 0.5F);
        GL11.glVertex3f(mx - 0.5F, my + 0.5F, mz + 0.5F); GL11.glVertex3f(mx + 0.5F, my + 0.5F, mz + 0.5F);
        
        GL11.glVertex3f(mx + 0.5F, my + 0.5F, mz - 0.5F); GL11.glVertex3f(mx + 0.5F, my + 0.5F, mz + 0.5F);
        GL11.glVertex3f(mx + 0.5F, my - 0.5F, mz - 0.5F); GL11.glVertex3f(mx + 0.5F, my - 0.5F, mz + 0.5F);
        GL11.glVertex3f(mx - 0.5F, my - 0.5F, mz - 0.5F); GL11.glVertex3f(mx - 0.5F, my - 0.5F, mz + 0.5F);
        GL11.glVertex3f(mx - 0.5F, my + 0.5F, mz - 0.5F); GL11.glVertex3f(mx - 0.5F, my + 0.5F, mz + 0.5F);
        
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glPopMatrix();
}

 

Actually it works but the cube disappear after few seconds (I want to stay perma) and I can't see it through walls.

Where am I wrong? :S

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.