Ignore local chunks if realtime updates are enabled
This commit is contained in:
@@ -25,6 +25,7 @@ import com.seibel.distanthorizons.core.Initializer;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.generation.DhLightingEngine;
|
||||
import com.seibel.distanthorizons.core.level.DhClientLevel;
|
||||
import com.seibel.distanthorizons.core.level.IDhLevel;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.core.logging.f3.F3Screen;
|
||||
@@ -231,6 +232,14 @@ public class SharedApi
|
||||
return;
|
||||
}
|
||||
|
||||
if (dhLevel instanceof DhClientLevel)
|
||||
{
|
||||
if (!((DhClientLevel) dhLevel).shouldProcessLocalChunkUpdates())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// shoudln't normally happen, but just in case
|
||||
if (UPDATE_POS_MANAGER.contains(chunkWrapper.getChunkPos()))
|
||||
{
|
||||
|
||||
@@ -278,8 +278,7 @@ public abstract class AbstractDhServerLevel extends AbstractDhLevel implements I
|
||||
|
||||
Vec3d playerPosition = serverPlayerState.getServerPlayer().getPosition();
|
||||
int distanceFromPlayer = DhSectionPos.getChebyshevSignedBlockDistance(data.getPos(), new DhBlockPos2D((int) playerPosition.x, (int) playerPosition.z)) / 16;
|
||||
if (distanceFromPlayer >= serverPlayerState.getServerPlayer().getViewDistance()
|
||||
&& distanceFromPlayer <= serverPlayerState.sessionConfig.getMaxUpdateDistanceRadius())
|
||||
if (distanceFromPlayer <= serverPlayerState.sessionConfig.getMaxUpdateDistanceRadius())
|
||||
{
|
||||
serverPlayerState.fullDataPayloadSender.sendInChunks(payload, () ->
|
||||
{
|
||||
|
||||
@@ -283,6 +283,8 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel
|
||||
return (renderState != null) ? renderState.renderBufferHandler : null;
|
||||
}
|
||||
|
||||
public boolean shouldProcessLocalChunkUpdates() { return this.networkState == null || !this.networkState.sessionConfig.isRealTimeUpdatesEnabled(); }
|
||||
|
||||
|
||||
|
||||
//===========//
|
||||
|
||||
Reference in New Issue
Block a user