Skip to content

Commit 5463ccc

Browse files
committed
Merge 1.20 into 1.21.1
2 parents dee2627 + 8e1270d commit 5463ccc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/ModernFix.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/chunk_meshing/RebuildTaskMixin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
import net.minecraft.client.renderer.chunk.SectionCompiler;
44
import net.minecraft.core.BlockPos;
55
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
6+
import org.embeddedt.modernfix.annotation.RequiresMod;
67
import org.embeddedt.modernfix.util.blockpos.SectionBlockPosIterator;
78
import org.spongepowered.asm.mixin.Mixin;
89
import org.spongepowered.asm.mixin.injection.At;
910
import org.spongepowered.asm.mixin.injection.Redirect;
1011

1112
@Mixin(value = SectionCompiler.class, priority = 2000)
1213
@ClientOnlyMixin
14+
@RequiresMod("!fluidlogged")
1315
public class RebuildTaskMixin {
1416
/**
1517
* @author embeddedt

0 commit comments

Comments
 (0)