Move the setupBuffers method to the ClientProxy

This commit is contained in:
James Seibel
2021-08-18 17:37:23 -05:00
parent aa1778cf82
commit ffb63ce8ef
2 changed files with 2 additions and 8 deletions
@@ -257,6 +257,7 @@ public class ClientProxy
// update the dimensions to fit the new width
lodWorld.resizeDimensionRegionWidth(newWidth);
lodNodeBuilder.defaultDimensionWidthInRegions = newWidth;
renderer.setupBuffers(newWidth);
//LOGGER.info("new dimension width in regions: " + newWidth + "\t potential: " + newWidth );
}
@@ -244,13 +244,6 @@ public class LodNodeRenderer
// (this is to prevent thread conflicts)
if (regen && !lodNodeBufferBuilder.generatingBuffers && !lodNodeBufferBuilder.newBuffersAvaliable())
{
// this will mainly happen when the view distance is changed
int renderDistance = mc.options.renderDistance;
int lodMultiplier = LodConfig.CLIENT.lodChunkRadiusMultiplier.get();
if (renderDistance != ClientProxy.previousChunkRenderDistance ||
lodMultiplier != ClientProxy.previousLodMultiplierDistance)
setupBuffers(lodDim.getWidth());
// generate the LODs on a separate thread to prevent stuttering or freezing
lodNodeBufferBuilder.generateLodBuffersAsync(this, lodDim, player.blockPosition(), numbChunksWide);
@@ -608,7 +601,7 @@ public class LodNodeRenderer
/**
* Create all buffers that will be used.
*/
private void setupBuffers(int numbRegionsWide)
public void setupBuffers(int numbRegionsWide)
{
// calculate the max amount of memory needed (in bytes)
int bufferMemory = RenderUtil.getBufferMemoryForRegion();