User Tools

Site Tools


tutorial:containers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tutorial:containers [2020/04/02 11:05]
earthcomputer Add more @Override annotations
tutorial:containers [2020/04/02 12:57] (current)
earthcomputer [Block and BlockItem] Revert BlockWithEntity change
Line 6: Line 6:
  
 <code java [enable_line_numbers="​true"​] BiggerChestBlock.java>​ <code java [enable_line_numbers="​true"​] BiggerChestBlock.java>​
-public class BiggerChestBlock extends ​Block implements BlockEntityProvider ​{+public class BiggerChestBlock extends ​BlockWithEntity ​{
     public BiggerChestBlock(Settings settings) {     public BiggerChestBlock(Settings settings) {
         super(settings);​         super(settings);​
 +    }
 +    ​
 +    // A side effect of extending BlockWithEntity is it changes the render type to INVISIBLE, so we have to revert this
 +    @Override
 +    public BlockRenderType getRenderType(BlockState state) {
 +        return BlockRenderType.MODEL;​
     }     }
  
tutorial/containers.txt ยท Last modified: 2020/04/02 12:57 by earthcomputer