pull/12/head
valoeghese 2020-03-02 20:36:21 +13:00
parent accb0e7b86
commit 031957fb23
1 changed files with 12 additions and 16 deletions

View File

@ -76,21 +76,17 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
public void render(BlockInstance[] renderList) public void render(BlockInstance[] renderList)
{ {
prepareRender(); prepareRender();
for (int x = 0; x < CHUNK_SIZE; x++)
for (int y = 0; y < CHUNK_SIZE; y++) for (BlockInstance entity : renderList) {
for (int z = 0; z < CHUNK_SIZE; z++) if (entity != null && entity.getModel() != null)
{ {
BlockInstance entity = renderList[Chunk.index(x, y, z)]; TexturedModel blockModel = entity.getModel();
if (entity != null && entity.getModel() != null) GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID());
{ prepBlockInstance(entity);
TexturedModel blockModel = entity.getModel(); GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID()); }
prepBlockInstance(entity); }
GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), // disableWireframe();
GL11.GL_UNSIGNED_INT, 0); // shader.stop();
}
}
disableWireframe();
shader.stop();
} }
} }