@@ -42,13 +42,11 @@ public class RenderRegion implements BlockAndTintGetter {
42
42
private TintCache tintCache ;
43
43
44
44
private final Map <BlockPos , BlockEntity > blockEntityMap ;
45
- private final int minHeight ;
46
45
47
46
private final Function <BlockPos , BlockState > blockStateGetter ;
48
47
49
48
RenderRegion (Level level , int x , int y , int z , PalettedContainer <BlockState >[] blockData , DataLayer [][] lightData , Map <BlockPos , BlockEntity > blockEntityMap ) {
50
49
this .level = level ;
51
- this .minHeight = level .getMinBuildHeight ();
52
50
53
51
this .minSecX = x - 1 ;
54
52
this .minSecY = y - 1 ;
@@ -144,7 +142,7 @@ public LevelLightEngine getLightEngine() {
144
142
145
143
public int getBrightness (LightLayer lightLayer , BlockPos blockPos ) {
146
144
int secX = SectionPos .blockToSectionCoord (blockPos .getX ()) - this .minSecX ;
147
- int secY = SectionPos .blockToSectionCoord (blockPos .getY () - minHeight ) - this .minSecY ;
145
+ int secY = SectionPos .blockToSectionCoord (blockPos .getY ()) - this .minSecY ;
148
146
int secZ = SectionPos .blockToSectionCoord (blockPos .getZ ()) - this .minSecZ ;
149
147
150
148
DataLayer dataLayer = this .lightData [getSectionIdx (secX , secY , secZ )][lightLayer .ordinal ()];
@@ -154,7 +152,7 @@ public int getBrightness(LightLayer lightLayer, BlockPos blockPos) {
154
152
155
153
public int getRawBrightness (BlockPos blockPos , int i ) {
156
154
int secX = SectionPos .blockToSectionCoord (blockPos .getX ()) - this .minSecX ;
157
- int secY = SectionPos .blockToSectionCoord (blockPos .getY () - minHeight ) - this .minSecY ;
155
+ int secY = SectionPos .blockToSectionCoord (blockPos .getY ()) - this .minSecY ;
158
156
int secZ = SectionPos .blockToSectionCoord (blockPos .getZ ()) - this .minSecZ ;
159
157
160
158
DataLayer [] dataLayers = this .lightData [getSectionIdx (secX , secY , secZ )];
@@ -199,7 +197,7 @@ public int getBlockIdx(int x, int y, int z) {
199
197
}
200
198
201
199
public BlockState defaultBlockState (BlockPos blockPos ) {
202
- return blockData [getBlockIdx (blockPos .getX (), blockPos .getY () - minHeight , blockPos .getZ ())];
200
+ return blockData [getBlockIdx (blockPos .getX (), blockPos .getY (), blockPos .getZ ())];
203
201
}
204
202
205
203
public BlockState debugBlockState (BlockPos blockPos ) {
0 commit comments