getBuilderArray wasn't initialised correctly causing a lot of new long[]

This commit is contained in:
cola98765
2021-09-30 12:28:04 +02:00
parent 8020b298fb
commit 529c52b93f
2 changed files with 7 additions and 6 deletions
@@ -461,12 +461,7 @@ public class LodBuilder
boolean hasSkyLight = mc.getClientWorld().dimensionType().hasSkyLight();
BlockPos.Mutable blockPos = new BlockPos.Mutable(0, 0, 0);
int index = 0;
if (dataToMerge == null)
{
dataToMerge = new long[size * size];
}
int index;
for (index = 0; index < size * size; index++)
{
xRel = Math.floorMod(index, size) + startX;
@@ -55,6 +55,12 @@ public class ThreadMapUtil
if (!threadBuilderArrayMap.containsKey(Thread.currentThread().getName()) || (threadBuilderArrayMap.get(Thread.currentThread().getName()) == null))
{
long[][] array = new long[5][];
int size = 1;
for (int i = 0; i < 5; i++)
{
array[i] = new long[size * size];
size = size << 1;
}
threadBuilderArrayMap.put(Thread.currentThread().getName(), array);
}
return threadBuilderArrayMap.get(Thread.currentThread().getName())[detailLevel];