@@ -101,12 +101,10 @@ private EncodingFormat() { }
101101 private static final int DIRECTION_COUNT = Direction .values ().length ;
102102 private static final int NULLABLE_DIRECTION_COUNT = DIRECTION_COUNT + 1 ;
103103
104- private static final ChunkSectionLayer [] CHUNK_SECTION_LAYERS = ChunkSectionLayer .values ();
105- private static final int CHUNK_SECTION_LAYER_COUNT = CHUNK_SECTION_LAYERS .length ;
106104 private static final RenderType [] ITEM_RENDER_TYPES = ItemRenderType .RENDER_TYPES ;
107105 private static final int ITEM_RENDER_TYPE_COUNT = ITEM_RENDER_TYPES .length ;
108- private static final @ Nullable ChunkSectionLayer [] NULLABLE_BLOCK_RENDER_LAYERS = ArrayUtils .add (ChunkSectionLayer .values (), null );
109- private static final int NULLABLE_BLOCK_RENDER_LAYER_COUNT = NULLABLE_BLOCK_RENDER_LAYERS .length ;
106+ private static final @ Nullable ChunkSectionLayer [] NULLABLE_CHUNK_SECTION_LAYERS = ArrayUtils .add (ChunkSectionLayer .values (), null );
107+ private static final int NULLABLE_CHUNK_SECTION_LAYER_COUNT = NULLABLE_CHUNK_SECTION_LAYERS .length ;
110108 private static final TriState [] TRI_STATES = TriState .values ();
111109 private static final int TRI_STATE_COUNT = TRI_STATES .length ;
112110 private static final @ Nullable ItemStackRenderState .FoilType [] NULLABLE_GLINTS = ArrayUtils .add (ItemStackRenderState .FoilType .values (), null );
@@ -116,16 +114,15 @@ private EncodingFormat() { }
116114 private static final SodiumQuadAtlas [] QUAD_ATLASES = SodiumQuadAtlas .values ();
117115 private static final int QUAD_ATLAS_COUNT = QUAD_ATLASES .length ;
118116
119- private static final int NULL_RENDER_LAYER_INDEX = NULLABLE_BLOCK_RENDER_LAYER_COUNT - 1 ;
117+ private static final int NULL_CHUNK_SECTION_LAYER_INDEX = NULLABLE_CHUNK_SECTION_LAYER_COUNT - 1 ;
120118 private static final int NULL_GLINT_INDEX = NULLABLE_GLINT_COUNT - 1 ;
121119
122120 private static final int CULL_BIT_LENGTH = Mth .ceillog2 (NULLABLE_DIRECTION_COUNT );
123121 private static final int LIGHT_BIT_LENGTH = Mth .ceillog2 (DIRECTION_COUNT );
124122 private static final int NORMALS_BIT_LENGTH = 4 ;
125123 private static final int NORMAL_FACE_BIT_LENGTH = 3 ;
126- private static final int CHUNK_LAYER_BIT_LENGTH = Mth .ceillog2 (CHUNK_SECTION_LAYER_COUNT );
124+ private static final int CHUNK_LAYER_BIT_LENGTH = Mth .ceillog2 (NULLABLE_CHUNK_SECTION_LAYER_COUNT );
127125 private static final int ITEM_RENDER_TYPE_BIT_LENGTH = Mth .ceillog2 (ITEM_RENDER_TYPE_COUNT );
128- private static final int RENDER_LAYER_BIT_LENGTH = Mth .ceillog2 (NULLABLE_BLOCK_RENDER_LAYER_COUNT );
129126 private static final int EMISSIVE_BIT_LENGTH = 1 ;
130127 private static final int DIFFUSE_BIT_LENGTH = 1 ;
131128 private static final int AO_BIT_LENGTH = Mth .ceillog2 (TRI_STATE_COUNT );
@@ -156,7 +153,7 @@ private EncodingFormat() { }
156153 private static final int NORMAL_FACE_MASK = bitMask (NORMAL_FACE_BIT_LENGTH , NORMAL_FACE_BIT_OFFSET );
157154 private static final int NORMALS_MASK = bitMask (NORMALS_BIT_LENGTH , NORMALS_BIT_OFFSET );
158155 private static final int GEOMETRY_MASK = bitMask (GEOMETRY_BIT_LENGTH , GEOMETRY_BIT_OFFSET );
159- private static final int RENDER_LAYER_MASK = bitMask (RENDER_LAYER_BIT_LENGTH , CHUNK_LAYER_BIT_OFFSET );
156+ private static final int CHUNK_LAYER_MASK = bitMask (CHUNK_LAYER_BIT_LENGTH , CHUNK_LAYER_BIT_OFFSET );
160157 private static final int QUAD_ATLAS_MASK = bitMask (QUAD_ATLAS_BIT_LENGTH , QUAD_ATLAS_BIT_OFFSET );
161158 private static final int EMISSIVE_MASK = bitMask (EMISSIVE_BIT_LENGTH , EMISSIVE_BIT_OFFSET );
162159 private static final int DIFFUSE_MASK = bitMask (DIFFUSE_BIT_LENGTH , DIFFUSE_BIT_OFFSET );
@@ -219,12 +216,12 @@ static int normalFace(int bits, ModelQuadFacing face) {
219216
220217 @ Nullable
221218 static ChunkSectionLayer renderLayer (int bits ) {
222- return NULLABLE_BLOCK_RENDER_LAYERS [(bits & RENDER_LAYER_MASK ) >>> CHUNK_LAYER_BIT_OFFSET ];
219+ return NULLABLE_CHUNK_SECTION_LAYERS [(bits & CHUNK_LAYER_MASK ) >>> CHUNK_LAYER_BIT_OFFSET ];
223220 }
224221
225222 static int renderLayer (int bits , @ Nullable ChunkSectionLayer renderLayer ) {
226- int index = renderLayer == null ? NULL_RENDER_LAYER_INDEX : renderLayer .ordinal ();
227- return (bits & ~RENDER_LAYER_MASK ) | (index << CHUNK_LAYER_BIT_OFFSET );
223+ int index = renderLayer == null ? NULL_CHUNK_SECTION_LAYER_INDEX : renderLayer .ordinal ();
224+ return (bits & ~CHUNK_LAYER_MASK ) | (index << CHUNK_LAYER_BIT_OFFSET );
228225 }
229226
230227 static boolean emissive (int bits ) {
0 commit comments