Skip to content

Commit

Permalink
fix: Use correct coordinate system for chunk updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed May 31, 2020
1 parent a86e00b commit f97321e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,16 @@ public void scheduleRebuildForBlockArea(int minX, int minY, int minZ, int maxX,
int maxChunkY = maxY >> 4;
int maxChunkZ = maxZ >> 4;

for (int chunkX = minChunkX; chunkX <= maxChunkX; chunkX++) {
for (int chunkY = minChunkY; chunkY <= maxChunkY; chunkY++) {
for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; chunkZ++) {
this.scheduleRebuildForChunks(minChunkX, minChunkY, minChunkZ, maxChunkX, maxChunkY, maxChunkZ, important);
}

/**
* Schedules chunk rebuilds for all chunks in the specified chunk region.
*/
public void scheduleRebuildForChunks(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean important) {
for (int chunkX = minX; chunkX <= maxX; chunkX++) {
for (int chunkY = minY; chunkY <= maxY; chunkY++) {
for (int chunkZ = minZ; chunkZ <= maxZ; chunkZ++) {
this.scheduleRebuildForChunk(chunkX, chunkY, chunkZ, important);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void scheduleBlockRenders(int minX, int minY, int minZ, int maxX, int max
*/
@Overwrite
public void scheduleBlockRenders(int x, int y, int z) {
this.renderer.scheduleRebuildForBlockArea(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1, false);
this.renderer.scheduleRebuildForChunks(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1, false);
}

/**
Expand Down

0 comments on commit f97321e

Please sign in to comment.