How should I edit the block model to render cullfaces properly?

Started by Dary on

Topic category: Help with modding (Java Edition)

Last seen on 12:17, 15. Mar 2024
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How should I edit the block model to render cullfaces properly?

Hello,

I'd like to make my transparent blocks( for example translucent stained glass) render properly if connected to other transparent blocks, but custom models with cullfaces do not work.Klemen said,that now it is not possible without using the code editor.

Maybe someone know the secret of culling and could explain how it should be done through the model's code?

Thanks in advance=)

Last seen on 12:17, 15. Mar 2024
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wow, I got it! Models with…
Tue, 01/21/2020 - 20:59

Wow, I got it! Models with cullfaces are not necessery.It works perfectly for the same type of my stained glass (that is normal, I do not want to mix them),maybe i will find how to do this with my other glass somehow=)

if someone is interested, i put that in the my glass class

@SideOnly(Side.CLIENT)
		@Override
		public boolean shouldSideBeRendered(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos pos, final EnumFacing side) {
			final IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
			final Block block = iblockstate.getBlock();
			if (blockState != iblockstate) {
				return true;
			}
			if (block == this) {
				return false;
			}
			return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
		}
	}