File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
common/src/main/java/org/embeddedt/modernfix Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,19 @@ public void onServerStarted() {
6363 ClassInfoManager .clear ();
6464 }
6565
66+ @ SuppressWarnings ("ConstantValue" )
6667 public void onServerDead (MinecraftServer server ) {
6768 /* Clear as much data from the integrated server as possible, in case a mod holds on to it */
6869 try {
6970 for (ServerLevel level : server .getAllLevels ()) {
7071 ChunkMap chunkMap = level .getChunkSource ().chunkMap ;
71- chunkMap .updatingChunkMap .clear ();
72- chunkMap .visibleChunkMap .clear ();
73- chunkMap .pendingUnloads .clear ();
72+ // Null check for mods that replace chunk system
73+ if (chunkMap .updatingChunkMap != null )
74+ chunkMap .updatingChunkMap .clear ();
75+ if (chunkMap .visibleChunkMap != null )
76+ chunkMap .visibleChunkMap .clear ();
77+ if (chunkMap .pendingUnloads != null )
78+ chunkMap .pendingUnloads .clear ();
7479 }
7580 } catch (RuntimeException e ) {
7681 ModernFix .LOGGER .error ("Couldn't clear chunk data" , e );
You can’t perform that action at this time.
0 commit comments