Add the ability to count the number of loaded LodChunks
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user