Add the ability to count the number of loaded LodChunks

This commit is contained in:
James Seibel
2021-05-31 16:41:27 -05:00
parent 4de5c287fc
commit 2f7f489e14
2 changed files with 40 additions and 4 deletions
@@ -69,10 +69,12 @@ public class LodChunkGenWorker implements IWorker
// useful for debugging
//if (lodDim.getLodFromCoordinates(x, z) != null)
// System.out.println(x + " " + z + " Success!");
//else
// System.out.println(x + " " + z);
// ClientProxy.LOGGER.info(lodDim.getNumberOfLods());
// if (lodDim.getLodFromCoordinates(x, z) != null)
// ClientProxy.LOGGER.info(x + " " + z + " Success!");
// else
// ClientProxy.LOGGER.info(x + " " + z);
}
// can be used for debugging
//else
@@ -334,6 +334,40 @@ public class LodDimension
}
/**
* Returns how many non-null LodChunks
* are stored in this LodDimension.
*/
public int getNumberOfLods()
{
int numbLods = 0;
for (LodRegion[] regions : regions)
{
if(regions == null)
continue;
for (LodRegion region : regions)
{
if(region == null)
continue;
for(LodChunk[] lods : region.getAllLods())
{
if(lods == null)
continue;
for(LodChunk lod : lods)
{
if (lod != null)
numbLods++;
}
}
}
}
return numbLods;
}
public int getWidth()
{