Do not clean up rendering on a dedicated server

This commit is contained in:
s809
2023-11-04 16:56:15 +05:00
parent 880abd0124
commit 84d36df388
@@ -79,6 +79,7 @@ public class SharedApi
public static void setDhWorld(AbstractDhWorld newWorld)
{
AbstractDhWorld prevWorld = currentWorld;
currentWorld = newWorld;
// starting and stopping the DataRenderTransformer is necessary to prevent attempting to
@@ -90,8 +91,12 @@ public class SharedApi
else
{
ThreadPools.shutdownThreadPools();
DebugRenderer.clearRenderables();
MC_RENDER.clearTargetFrameBuffer();
if (prevWorld != null && prevWorld.environment != EWorldEnvironment.Server_Only)
{
DebugRenderer.clearRenderables();
MC_RENDER.clearTargetFrameBuffer();
}
// recommend that the garbage collector cleans up any objects from the old world and thread pools
System.gc();