Also use the original camera position when Immersive Portals is loaded.
This commit is contained in:
@@ -112,23 +112,9 @@ public class ClientLevelModule implements Closeable, IDataSourceUpdateListenerFu
|
||||
this.ClientRenderStateRef.set(clientRenderState);
|
||||
}
|
||||
|
||||
DhBlockPos2D cameraBlockPos;
|
||||
IImmersivePortalsAccessor immersivePortalsAccessor = ModAccessorInjector.INSTANCE.get(IImmersivePortalsAccessor.class);
|
||||
if (immersivePortalsAccessor != null)
|
||||
{
|
||||
// since Immersive portals could be rendering multiple levels at once
|
||||
// the camera position may not be relative to this level,
|
||||
// but the player position will be (usually)
|
||||
DhBlockPos playerBlockPos = MC_CLIENT.getPlayerBlockPos();
|
||||
cameraBlockPos = new DhBlockPos2D(playerBlockPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
// use camera position instead of player pos so free cam mods work better
|
||||
Vec3d cameraDoublePos = MC_RENDER.getCameraExactPosition();
|
||||
cameraBlockPos = new DhBlockPos2D((int)cameraDoublePos.x, (int)cameraDoublePos.z);
|
||||
}
|
||||
|
||||
// use camera position instead of player pos so free cam mods work better
|
||||
Vec3d cameraDoublePos = MC_RENDER.getCameraExactPosition();
|
||||
DhBlockPos2D cameraBlockPos = new DhBlockPos2D((int)cameraDoublePos.x, (int)cameraDoublePos.z);
|
||||
clientRenderState.quadtree.tryTick(cameraBlockPos);
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -21,6 +21,7 @@ package com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor;
|
||||
|
||||
import com.seibel.distanthorizons.core.pos.DhChunkPos;
|
||||
import com.seibel.distanthorizons.core.pos.blockPos.DhBlockPos;
|
||||
import com.seibel.distanthorizons.core.util.math.Vec3d;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -40,4 +41,7 @@ public interface IImmersivePortalsAccessor extends IModAccessor
|
||||
@Nullable
|
||||
IClientLevelWrapper getOriginalClientLevelWrapper();
|
||||
|
||||
@Nullable
|
||||
Vec3d getOriginalCameraPos();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user