Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey i have som trouble to get this code work right... it doesent render transparent and i realy not know why

 

Every tipp is welcome ;)

 

So heres the code ;)

 

@ForgeSubscribe
public void onRender(RenderWorldLastEvent event) {	
Chunk hilfs = mc.theWorld.getChunkFromBlockCoords((int)mc.thePlayer.posX, (int)mc.thePlayer.posZ);
    	ChunkCoordIntPair hilfs1 = hilfs.getChunkCoordIntPair();
    	AxisAlignedBB box = AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)hilfs1.getCenterXPos()-6, (double)0, (double)hilfs1.getCenterZPosition()-6, (double)hilfs1.getCenterXPos()+6, (double)256, (double)hilfs1.getCenterZPosition()+6);
         
         
         
        GL11.glPushMatrix();
         
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
         
        GL11.glTranslatef((float)-mc.thePlayer.posX,(float)-mc.thePlayer.posY, (float)mc.thePlayer.posZ);
        GL11.glColor4d(0, 200, 0, 128);
         

	//Bottom
	/**var2.addVertex(box.minX, box.minY, box.maxZ);
         var2.addVertex(box.minX, box.minY, box.minZ);
         var2.addVertex(box.maxX, box.minY, box.minZ);
         var2.addVertex(box.maxX, box.minY, box.maxZ);
         **/
         //Top
         GL11.glBegin(GL11.GL_QUADS);
         GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
         GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
         GL11.glVertex3d(box.minX, box.maxY, box.minZ);
         GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
         GL11.glEnd();
         
         //Side-East
         GL11.glBegin(GL11.GL_QUADS);
         GL11.glVertex3d(box.minX, box.maxY, box.minZ);
         GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
         GL11.glVertex3d(box.maxX, box.minY, box.minZ);
         GL11.glVertex3d(box.minX, box.minY, box.minZ);
         GL11.glEnd();
         
         //Side-West
         GL11.glBegin(GL11.GL_QUADS);
         GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
         GL11.glVertex3d(box.minX, box.minY, box.maxZ);
         GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
         GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
         GL11.glEnd();
         
         //Side-Norh
         GL11.glBegin(GL11.GL_QUADS);
         GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
         GL11.glVertex3d(box.minX, box.maxY, box.minZ);
         GL11.glVertex3d(box.minX, box.minY, box.minZ);
         GL11.glVertex3d(box.minX, box.minY, box.maxZ);
         GL11.glEnd();
         
         //Side-South
         GL11.glBegin(GL11.GL_QUADS);
         GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
         GL11.glVertex3d(box.maxX, box.minY, box.minZ);
         GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
         
         GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
         GL11.glEnd();
         
         GL11.glDisable(GL11.GL_BLEND);
         GL11.glEnable(GL11.GL_TEXTURE_2D);
         GL11.glPopMatrix();
}

 

Not sure but I think that you'll get a step further maybe if you do this:

Put this line:

GL11.glEnable(GL11.GL_BLEND);

Above this line:

        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

Not sure but I think it may work, at least worth trying :)

 

After that you can try replacing:

GL11.GL_ONE_MINUS_SRC_ALPHA

With

GL11.GL_ONE

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.