Skip to content

Commit

Permalink
Fix chunk edge render
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Apr 12, 2024
1 parent 470d674 commit faebf66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ChunkVertexData call() throws Exception {
final int nx = x + direction.axisX();
final int ny = y + direction.axisY();
final int nz = z + direction.axisZ();
if (chunk.isInBound(nx, ny, nz) && chunk.getBlockType(nx, ny, nz).air()) {
if (chunk.getBlockType(nx, ny, nz).air()) {
gameRenderer.blockRenderer().renderBlockFace(
builder,
chunk.getBlockType(x, y, z),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ public void markDirty() {

@Override
public void close(GLStateMgr gl) {
if (future != null && future.state() == Future.State.SUCCESS) {
try {
future.get().arena().close();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
gl.deleteVertexArrays(vao);
gl.deleteBuffers(vbo, ebo);
}
Expand Down

0 comments on commit faebf66

Please sign in to comment.