Skip to content

Commit

Permalink
Cleanup null check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Grayray75 committed Aug 12, 2023
1 parent 93abd47 commit ef96600
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,10 @@ private int recheckGapsGetLowestHeight(WorldChunkSlice slice, int x, int z) {
int j = x + facing.getOffsetX();
int k = z + facing.getOffsetZ();

// TODO: revisit this patch!!!
Chunk chunk = slice.getChunkFromWorldCoords(j, k);
int minHeight = max;
if (chunk != null) {
minHeight = chunk.getMinimumHeightMap();
max = Math.min(max, chunk.getMinimumHeightMap());
}

max = Math.min(max, minHeight);
}

return max;
Expand All @@ -262,7 +258,6 @@ private void checkSkylightNeighborHeight(WorldChunkSlice slice, int x, int z, in
}

Chunk chunk = slice.getChunkFromWorldCoords(x, z);

if (chunk == null) {
PhosphorMod.LOGGER.warn("Chunk is null! x: " + x + " z: " + z + " maxValue: " + maxValue);
return;
Expand All @@ -280,10 +275,6 @@ else if (i < maxValue) {

private void updateSkylightNeighborHeight(WorldChunkSlice slice, int x, int z, int startY, int endY) {
if (endY > startY) {
/*if (!slice.isLoaded(x, z, 16)) {
return;
}*/

for (int i = startY; i < endY; ++i) {
this.world.method_8539(LightType.SKY, new BlockPos(x, i, z));
}
Expand Down

0 comments on commit ef96600

Please sign in to comment.