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'm trying to do the following:

 

If two blocks from my mod collide by one (or more) faces, then those faces, which collides, shouldn't be rendered.

 

And i have the following problem:

 

Those two block are one next to other and their top and bottom faces a colliding, but the don't become "invisible":

 

 

 

But if move the block above, (1 meter) up, then the top face of the lower block becomes invisible:

 

 

And if the block is "alone", the side renders correctly:

 

 


 

Here is my code

 

@Override
public boolean shouldSideBeRendered(IBlockAccess block, int x, int y, int z, int side)
{
	// -Y
	if(side == 0 && isBlockACamouflage(block.getBlockId(x, y - 1, z)))
	{
		return false;
	}

	// +Y
	if(side == 1 && isBlockACamouflage(block.getBlockId(x, y + 1, z)))
	{
		return false;
	}

	// -Z
	if(side == 2)
	{
		return false;
	}

	else
	{
		return true;
	}
}

 

 

PS: isBlockACamouflage() only check is the block is one added my the mod or not

 

Thanks for helping.

Hi

 

BlockBreakable::

    * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given

    * coordinates.  Args: blockAccess, x, y, z, side

    public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int x, int y, int z, int side)

    {

        int i1 = par1IBlockAccess.getBlockId(x, y, z);

        return !this.localFlag && i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, x, y, z, side);

    }

 

x,y,z is the coordinates of the adjacent block, not the block being rendered.

 

-TGG

  • Author

Hi

 

BlockBreakable::

    * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given

    * coordinates.  Args: blockAccess, x, y, z, side

    public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int x, int y, int z, int side)

    {

        int i1 = par1IBlockAccess.getBlockId(x, y, z);

        return !this.localFlag && i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, x, y, z, side);

    }

 

x,y,z is the coordinates of the adjacent block, not the block being rendered.

 

-TGG

 

Okay, thanks, it works  ;D

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.