I have been looking at the 1.16.5 version and I went to add 3 blocks into the game or something with a custom model.
So, I wanted to make an aether block, a green portal block, and a nether portal block.
This is what I get with transparent textures with the code specifying that the block is transparent in the code:
Here is the code:
The one on the left being the aether portal block I went to render as a transparent model block using builder:
package aku.example.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
public class aether_portal_block extends Block
{
public aether_portal_block(Properties builder) {
super(builder);
}
public BlockRenderType getRenderType(BlockState state)
{
return BlockRenderType.MODEL;
}
public boolean isOpaque() {
return true;
}
public boolean isTransparent(BlockState state, IBlockReader reader, BlockPos pos) {
return true;
}
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
return true;
}
}
The green portal block in the middle looking like so as a default block using properties:
package aku.example.blocks;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
public class green_portal extends Block
{
public green_portal(AbstractBlock.Properties properties)
{
super(properties);
this.setDefaultState(super.getDefaultState());
}
public boolean isOpaque() {
return true;
}
public boolean isTransparent(BlockState state)
{
return true;
}
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
{
return stateIn;
}
}
The nether portal block:
package aku.example.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
public class nether_portal_block extends Block
{
public nether_portal_block(Block.Properties properties)
{
super(properties);
}
public BlockRenderType getRenderType(BlockState state)
{
return BlockRenderType.MODEL;
}
public boolean isOpaque() {
return true;
}
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos)
{
return true;
}
public boolean isTransparent(BlockState state)
{
return true;
}
}
None of these blocks render transparent in the game however.
This is the invisible texture:
When I use the invisible texture and apply it as a .png to something in the game the item will render invisible with the texture, but the block is wrong:
Which version of Minecraft was this implemented in?
This does not work on the 1.16.5 version because it does not recognize invisible textures, although I am able to make crafting recipes for blocks.
But only z-fighting ones where the invisible texture doesn't work or they remove how glass panes work in the next update or two.
This is rather a frustrating update where invisible is not a recognizable texture, which then uses more resources, and it makes no sense that a texture works for both items and entities but not for a block.
You should be able to copy the code from BlockGlass (or whatever they call it in 1.16.5), which renders transparency without any issues; likewise, translucent blocks should be able to use the code from BlockIce or other similar vanilla blocks (I only mod 1.6.4 so I have no idea exactly how newer versions work but they should have the same basic code that tells whether adjacent blocks should render next to them and whether the texture is opaque only (no transparency allowed, which is new to 1.8+), transparent/opaque (0/100% transparency), or translucent).
This is what needs to be a transparent block so you can see through the bottom of it (or to where you can see through the ground):
public class example_block extends Block
{
public example_block(Block.Properties properties)
{
super(properties);
}
public BlockRenderType getRenderType(BlockState state)
{
return BlockRenderType.MODEL;
}
public boolean isOpaque() {
return false;
}
public boolean putsHoleInTheGround(BlockState state, IBlockReader reader, BlockPos pos)
{
return true;
}
public boolean isTransparent(BlockState state)
{
return true;
}
}
If the block itself is transparent and it's solid but you can't see all the way through all parts of it then it is not opaque for example, then it would be:
public class example_block extends Block
{
public example_block(AbstractBlock.Properties properties)
{
super(properties);
this.setDefaultState(super.getDefaultState());
}
public boolean isOpaque() {
return false;
}
public boolean isTransparent(BlockState state)
{
return true;
}
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
{
return stateIn;
}
}
Which then would return a transparent block of something you can not see through all parts of. If it is opaque then it is not able to be seen through.
Returning false for that it's opaque in the above statement is clarifying that the block can be seen through and it's transparent.
It is true that the block is transparent so that is returned as true.
You should not be able to return that the block is opaque and it render transparent.
opaque
ADJECTIVE
not able to be seen through; not transparent.
If the aether portal block rendered at all I would say go with the word builder instead of the word properties.
Although, this has always been the word properties so there very well may be a reason for that.
I have been looking at the 1.16.5 version and I went to add 3 blocks into the game or something with a custom model.
So, I wanted to make an aether block, a green portal block, and a nether portal block.
This is what I get with transparent textures with the code specifying that the block is transparent in the code:
Here is the code:
The one on the left being the aether portal block I went to render as a transparent model block using builder:
The green portal block in the middle looking like so as a default block using properties:
The nether portal block:
None of these blocks render transparent in the game however.
This is the invisible texture:
When I use the invisible texture and apply it as a .png to something in the game the item will render invisible with the texture, but the block is wrong:
Which version of Minecraft was this implemented in?
This does not work on the 1.16.5 version because it does not recognize invisible textures, although I am able to make crafting recipes for blocks.
But only z-fighting ones where the invisible texture doesn't work or they remove how glass panes work in the next update or two.
This is rather a frustrating update where invisible is not a recognizable texture, which then uses more resources, and it makes no sense that a texture works for both items and entities but not for a block.
You should be able to copy the code from BlockGlass (or whatever they call it in 1.16.5), which renders transparency without any issues; likewise, translucent blocks should be able to use the code from BlockIce or other similar vanilla blocks (I only mod 1.6.4 so I have no idea exactly how newer versions work but they should have the same basic code that tells whether adjacent blocks should render next to them and whether the texture is opaque only (no transparency allowed, which is new to 1.8+), transparent/opaque (0/100% transparency), or translucent).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
This is usually true, although whenever the code does not work entirely that is not the case.
The same basic code does not exist, like I'm not even sure what this is:
This is what needs to be a transparent block so you can see through the bottom of it (or to where you can see through the ground):
If the block itself is transparent and it's solid but you can't see all the way through all parts of it then it is not opaque for example, then it would be:
Which then would return a transparent block of something you can not see through all parts of. If it is opaque then it is not able to be seen through.
Returning false for that it's opaque in the above statement is clarifying that the block can be seen through and it's transparent.
It is true that the block is transparent so that is returned as true.
You should not be able to return that the block is opaque and it render transparent.
opaque
ADJECTIVE
If the aether portal block rendered at all I would say go with the word builder instead of the word properties.
Although, this has always been the word properties so there very well may be a reason for that.
I changed the code of one of my blocks to exactly the same thing as GlassBlock and in game the model or block does not render transparent.
The texture I am applying to the block is a transparent texture such as nether portal, which is animated.
Extending GlassBlock also results in a block that is not transparent.
The texture I am using is transparent.
Invisible textures do not work on blocks such as the default invisible texture.