Changes

m
Missed one
Line 1: Line 1:  
A <code>BlockEntityRenderer</code> or <code>BER</code> is used to render blocks in a way that cannot be represented with a static baked model (JSON, OBJ, B3D, etc.). A block entity renderer requires the block to have a <code>BlockEntity</code>.
 
A <code>BlockEntityRenderer</code> or <code>BER</code> is used to render blocks in a way that cannot be represented with a static baked model (JSON, OBJ, B3D, etc.). A block entity renderer requires the block to have a <code>BlockEntity</code>.
   −
==Creating a BER==
+
== Creating a BER ==
 
To create a BER, create a class that inherits from <code>BlockEntityRenderer</code>. It takes a generic argument specifying the block's <code>BlockEntity</code> class. The generic argument is used in the BER's <code>render</code> method.
 
To create a BER, create a class that inherits from <code>BlockEntityRenderer</code>. It takes a generic argument specifying the block's <code>BlockEntity</code> class. The generic argument is used in the BER's <code>render</code> method.
    
Only one BER exists for a given <code>BlockEntityType</code>. Therefore, values that are specific to a single instance in the world should be stored in the block entity being passed to the renderer rather than in the BER itself. For example, an integer that increments every frame, if stored in the BER, will increment every frame for every block entity of this type in the world.
 
Only one BER exists for a given <code>BlockEntityType</code>. Therefore, values that are specific to a single instance in the world should be stored in the block entity being passed to the renderer rather than in the BER itself. For example, an integer that increments every frame, if stored in the BER, will increment every frame for every block entity of this type in the world.
   −
===<code> render </code>===
+
=== <code>render</code> ===
 
This method is called every frame in order to render the block entity.
 
This method is called every frame in order to render the block entity.
   −
===Parameters===
+
=== Parameters ===
    
* <code>blockEntity</code>: This is the instance of the block entity being rendered.
 
* <code>blockEntity</code>: This is the instance of the block entity being rendered.
Line 18: Line 18:  
* <code>combinedOverlay</code>: An integer set to the current overlay of the block entity, usually <code>OverlayTexture#NO_OVERLAY</code> or 655,360.
 
* <code>combinedOverlay</code>: An integer set to the current overlay of the block entity, usually <code>OverlayTexture#NO_OVERLAY</code> or 655,360.
   −
==Registering a BER==
+
== Registering a BER ==
 
In order to register a BER, you must subscribe to the <code>EntityRenderersEvent$RegisterRenderers</code> event on the mod event bus and call <code>#registerBlockEntityRenderer</code>.
 
In order to register a BER, you must subscribe to the <code>EntityRenderersEvent$RegisterRenderers</code> event on the mod event bus and call <code>#registerBlockEntityRenderer</code>.