Merge remote-tracking branch 'origin/1.16.5' into 1.16.5

This commit is contained in:
Leonardo
2021-08-19 11:31:40 +02:00
2 changed files with 2 additions and 8 deletions
@@ -258,6 +258,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 );
}
@@ -246,13 +246,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);
@@ -610,7 +603,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();