Changed how blockUpdate works

This commit is contained in:
tom lee
2022-01-25 18:25:46 +08:00
parent 43feb2d7fe
commit 410fe684ec
2 changed files with 6 additions and 2 deletions
@@ -95,7 +95,7 @@ public class ClientApi
}
private final ConcurrentHashMap.KeySetView<Long,Boolean> generating = ConcurrentHashMap.newKeySet();
private final ConcurrentHashMap.KeySetView<Long,Boolean> toBeLoaded = ConcurrentHashMap.newKeySet();
public final ConcurrentHashMap.KeySetView<Long,Boolean> toBeLoaded = ConcurrentHashMap.newKeySet();
public void clientChunkLoadEvent(IChunkWrapper chunk, IWorldWrapper world)
{
@@ -21,6 +21,7 @@ package com.seibel.lod.core.api;
import org.lwjgl.glfw.GLFW;
import com.seibel.lod.core.api.ClientApi.LagSpikeCatcher;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.builders.worldGeneration.LodWorldGenerator;
import com.seibel.lod.core.enums.WorldType;
@@ -171,8 +172,11 @@ public class EventApi
public void blockChangeEvent(IChunkWrapper chunk, IDimensionTypeWrapper dimType)
{
if (dimType != MC.getCurrentDimension()) return;
// recreate the LOD where the blocks were changed
ApiShared.lodBuilder.generateLodNodeAsync(chunk, ApiShared.lodWorld, dimType);
LagSpikeCatcher blockChangeUpdate = new LagSpikeCatcher();
ClientApi.INSTANCE.toBeLoaded.add(chunk.getLongChunkPos());
blockChangeUpdate.end("clientChunkLoad");
}