From cb889d7430396c5949025a9ecbc1c307d66f0530 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 22 Aug 2021 18:26:59 -0500 Subject: [PATCH] auto formatting --- .../seibel/lod/builders/LodBufferBuilder.java | 100 +++++++++--------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java b/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java index 51ff5565f..f1ac476fb 100644 --- a/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java +++ b/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java @@ -230,24 +230,25 @@ public class LodBufferBuilder } if (lodDim.doesDataExist(pos)) - { - try - { - width = (int) Math.pow(2, pos.detailLevel); - lodData = lodDim.getData(pos); - - if (lodData != null) - { - LodConfig.CLIENT.lodTemplate.get().template.addLodToBuffer(currentBuffer, lodDim, lodData, - pos.posX * width, 0, pos.posZ * width, renderer.debugging, pos.detailLevel); - } - } catch (ArrayIndexOutOfBoundsException e) - { - ClientProxy.LOGGER.warn("LodBufferBuilder ran into trouble and had to start over."); - closeBuffers(); - return; - } - } + { + try + { + width = (int) Math.pow(2, pos.detailLevel); + lodData = lodDim.getData(pos); + + if (lodData != null) + { + LodConfig.CLIENT.lodTemplate.get().template.addLodToBuffer(currentBuffer, lodDim, lodData, + pos.posX * width, 0, pos.posZ * width, renderer.debugging, pos.detailLevel); + } + } + catch (ArrayIndexOutOfBoundsException e) + { + ClientProxy.LOGGER.warn("LodBufferBuilder ran into trouble and had to start over."); + closeBuffers(); + return; + } + } } @@ -361,21 +362,23 @@ public class LodBufferBuilder chunksToGen.clear(); chunksToGen.add(pos); - } else if (newDistance == minChunkDist) - { - // this chunk position as close as the minimum distance - if (chunksToGen.size() < maxChunkGenRequests) - { - // we are still under the number of chunks to generate - // add this position to the list - chunksToGen.add(pos); - } - } else - { - // this chunk is farther away than the minimum distance, - // add it to the reserve to make sure we always have a full reserve - chunksToGenReserve.add(pos); - } + } + else if (newDistance == minChunkDist) + { + // this chunk position as close as the minimum distance + if (chunksToGen.size() < maxChunkGenRequests) + { + // we are still under the number of chunks to generate + // add this position to the list + chunksToGen.add(pos); + } + } + else + { + // this chunk is farther away than the minimum distance, + // add it to the reserve to make sure we always have a full reserve + chunksToGenReserve.add(pos); + } } // lod null and can generate more chunks } // positions to generate @@ -428,21 +431,22 @@ public class LodBufferBuilder // mark that the buildable buffers as ready to swap switchVbos = true; - } catch (Exception e) - { - ClientProxy.LOGGER.warn("\"LodNodeBufferBuilder.generateLodBuffersAsync\" ran into trouble: "); - e.printStackTrace(); - } finally - { - // regardless of if we successfully created the buffers - // we are done generating. - generatingBuffers = false; - - - // clean up any potentially open resources - if (buildableBuffers != null) - closeBuffers(); - } + } + catch (Exception e) + { + ClientProxy.LOGGER.warn("\"LodNodeBufferBuilder.generateLodBuffersAsync\" ran into trouble: "); + e.printStackTrace(); + } + finally + { + // regardless of if we successfully created the buffers + // we are done generating. + generatingBuffers = false; + + // clean up any potentially open resources + if (buildableBuffers != null) + closeBuffers(); + } });