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

I am trying to make a laser block... it is semi-transparent, and doesn't fill in the 1 block bounding box.

Somehow the block is being shaded, even though i set the opacity.

 

This is how it looks:

xBwjcF3.png

 

 

Here's my code:

protected TileLaser(Material material) {
	super(material);
	float fac = (0.9F)/2;
	this.setBlockBounds(0.0F, fac, fac, 1.0F, 1-fac, 1-fac);
	this.setLightLevel(0.5F);
	this.setLightOpacity(0);
	this.setCreativeTab(CreativeTabs.tabRedstone);
	this.useNeighborBrightness = true;
}

@Override
public boolean isOpaqueCube() {
	return false;
}

@Override
public int getRenderBlockPass(){
	return 1;
}

 

thanks in advance from germany

  • Author

i would also appreciate, if someone knew how not to render the back face of the laser, but the back faces of other blocks

Maybe add those two methods to your Block class.

@Override
public boolean isOpaqueCube()
{
    return false;
}

@Override
public boolean isNormalCube()
{
   return false;
}

  • Author

thanks very much! i managed to figure it out before you answered, but didnt have time to respond, but thanks anyway!

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.