Jump to content

[1.18] [SOLVED] Custom block with transparent parts makes block behind invisible


Recommended Posts

Posted (edited)

Hey, I'm fairly new to the modding community and I'm coding a Mod that includes Vertical Slabs for 1.18.

Coding the Slabs I pretty much took the way Stairs are made and just removed the bottom extended part.

I wanted to take the Original Minecraft textures and after hours of getting the ColorMaps and Tinting to work I realized, that Blocks behind the full Block Side are not rendered. I read something about "culling" but I didn't quite understand.

It looks like this:

unknown.png

 

unknown.png

 

unknown.png

I suspect that the problem is not in my .json Files but in my custom class "ConnectableWallBlock" because it doesn't really matter, even if I take the original oak leaves json it doesn't work. I also tried taking the getVisualShape (like in the AbstractGlassBlock class) and making it return shapes.empty but that didn't work either.

I have .noOcclusion() in my Constructor Chain and in my ClientSetup I also call RenderType cutout.
At the moment I have no clue what else I could try to make it work.

GitHub:

https://github.com/Brainterminator/utilityblocks (look at the MoreWallBlocks Branch)

I hope you guys have some ideas!

Edited by Brainterminator
Posted

I suggest you create a new ConnectableWallBlock that extends LeavesBlock, setting the PERSISTENT state property to true (because I imagine your walls don't need to decay). This way most of the leaf property you would expect from a block made of leaves should be already included and you also take advantage of Minecraft automatically setting the render layer to cutoutMipped or solid depending on the user graphic settings.

Maybe won't solve your problem but it's sure a step forward.

Posted (edited)
2 hours ago, X-Lomir said:

I suggest you create a new ConnectableWallBlock that extends LeavesBlock, setting the PERSISTENT state property to true (because I imagine your walls don't need to decay). This way most of the leaf property you would expect from a block made of leaves should be already included and you also take advantage of Minecraft automatically setting the render layer to cutoutMipped or solid depending on the user graphic settings.

Maybe won't solve your problem but it's sure a step forward.

That actually fixed it! Now my LeafWalls have correct transparency! And the fact that they also adapt according to the graphics settings is also nice!
Thanks so much!

Edited by Brainterminator
  • Like 1
  • Brainterminator changed the title to [1.18] [SOLVED] Custom block with transparent parts makes block behind invisible

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.