tutorial:blockappearance
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
tutorial:blockappearance [2020/01/17 13:42] – 1.14 fixes juuz | tutorial:blockappearance [2020/01/17 13:53] – 1.15 juuz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Manipulating a Block' | ====== Manipulating a Block' | ||
+ | |||
+ | //This is the 1.15 version of this tutorial. For the 1.14 version, see [[tutorial: | ||
+ | |||
===== Making a block transparent ===== | ===== Making a block transparent ===== | ||
You may have noticed that even if your block' | You may have noticed that even if your block' | ||
- | To fix this, override | + | To fix this, you need to set your block's render layer to cutout or transparent. |
- | <code java> | + | |
- | class MyBlock extends Block { | + | |
- | @Override | + | |
- | public BlockRenderLayer getRenderLayer() { | + | |
- | return BlockRenderLayer.TRANSLUCENT; | + | |
- | } | + | |
- | + | ||
- | [...] | + | |
- | } | + | |
+ | In a client-sided mod initializer, | ||
+ | <code java> | ||
+ | BlockRenderLayerMap.INSTANCE.putBlock(ExampleMod.MY_BLOCK, | ||
+ | // Replace `RenderLayer.getCutout()` with `RenderLayer.getTranslucent()` if you have a translucent texture. | ||
</ | </ | ||
tutorial/blockappearance.txt · Last modified: 2024/02/05 16:03 by haykam