I'm making a custom block that's not full-size. The block itself works, but when I place it next to the basic blocks (like dirt on the example) they stop rendering the face that meets my block.
I know that's usually done to save resources and all that, but given my block doesn't cover them fully, it's a problem.
I also know glass doesn't cause that, but I have no idea what the code would be to avoid culling on other blocks.
So, anyone knows a solution to this? Thanks beforehand!
You probably need to override Block#isOpaqueCube to return false and Block#getBlockLayer to return CUTOUT or CUTOUT_MIPPED. You can see how this is handled for Glass in BlockGlass and BlockBreakable.
This post by The Grey Ghost explains block rendering (including layers) in more detail.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Hm, I've been borowsing, and now I'm not sure where that override should go. Should I make a new material type for the block? Or when is it called?
Both the methods I mentioned are methods of the Block class (hence the Block in the ClassName#methodName notation), so they can only be overridden in a class that extends from Block (the class used to implement your block).
This tutorial explains override methods in more detail.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'm making a custom block that's not full-size. The block itself works, but when I place it next to the basic blocks (like dirt on the example) they stop rendering the face that meets my block.
I know that's usually done to save resources and all that, but given my block doesn't cover them fully, it's a problem.
I also know glass doesn't cause that, but I have no idea what the code would be to avoid culling on other blocks.
So, anyone knows a solution to this? Thanks beforehand!
You probably need to override Block#isOpaqueCube to return false and Block#getBlockLayer to return CUTOUT or CUTOUT_MIPPED. You can see how this is handled for Glass in BlockGlass and BlockBreakable.
This post by The Grey Ghost explains block rendering (including layers) in more detail.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Hm. By what you linked, yes, seems ike that would be a solution~ now to find out how to override those~! Thanks~
Hm, I've been browsing, and now I'm not sure where that override should go. Should I make a new material type for the block? Or when is it called?
Both the methods I mentioned are methods of the Block class (hence the Block in the ClassName#methodName notation), so they can only be overridden in a class that extends from Block (the class used to implement your block).
This tutorial explains override methods in more detail.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.