From 031957fb23b1d6b85a4dc99ffee178f62b2b0801 Mon Sep 17 00:00:00 2001 From: valoeghese Date: Mon, 2 Mar 2020 20:36:21 +1300 Subject: [PATCH] e --- .../litecraft/world/block/BlockRenderer.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/halotroop/litecraft/world/block/BlockRenderer.java b/src/main/java/com/github/halotroop/litecraft/world/block/BlockRenderer.java index 7651a9e..c641774 100644 --- a/src/main/java/com/github/halotroop/litecraft/world/block/BlockRenderer.java +++ b/src/main/java/com/github/halotroop/litecraft/world/block/BlockRenderer.java @@ -76,21 +76,17 @@ public class BlockRenderer extends Renderer implements WorldGenConstants public void render(BlockInstance[] renderList) { prepareRender(); - for (int x = 0; x < CHUNK_SIZE; x++) - for (int y = 0; y < CHUNK_SIZE; y++) - for (int z = 0; z < CHUNK_SIZE; z++) - { - BlockInstance entity = renderList[Chunk.index(x, y, z)]; - if (entity != null && entity.getModel() != null) - { - TexturedModel blockModel = entity.getModel(); - GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID()); - prepBlockInstance(entity); - GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), - GL11.GL_UNSIGNED_INT, 0); - } - } - disableWireframe(); - shader.stop(); + + for (BlockInstance entity : renderList) { + if (entity != null && entity.getModel() != null) + { + TexturedModel blockModel = entity.getModel(); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID()); + prepBlockInstance(entity); + GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0); + } + } +// disableWireframe(); +// shader.stop(); } }