Merge 1.20 into 1.21.1
This commit is contained in:
commit
5463ccc3e6
|
|
@ -63,14 +63,19 @@ public class ModernFix {
|
||||||
ClassInfoManager.clear();
|
ClassInfoManager.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantValue")
|
||||||
public void onServerDead(MinecraftServer server) {
|
public void onServerDead(MinecraftServer server) {
|
||||||
/* Clear as much data from the integrated server as possible, in case a mod holds on to it */
|
/* Clear as much data from the integrated server as possible, in case a mod holds on to it */
|
||||||
try {
|
try {
|
||||||
for(ServerLevel level : server.getAllLevels()) {
|
for(ServerLevel level : server.getAllLevels()) {
|
||||||
ChunkMap chunkMap = level.getChunkSource().chunkMap;
|
ChunkMap chunkMap = level.getChunkSource().chunkMap;
|
||||||
chunkMap.updatingChunkMap.clear();
|
// Null check for mods that replace chunk system
|
||||||
chunkMap.visibleChunkMap.clear();
|
if(chunkMap.updatingChunkMap != null)
|
||||||
chunkMap.pendingUnloads.clear();
|
chunkMap.updatingChunkMap.clear();
|
||||||
|
if(chunkMap.visibleChunkMap != null)
|
||||||
|
chunkMap.visibleChunkMap.clear();
|
||||||
|
if(chunkMap.pendingUnloads != null)
|
||||||
|
chunkMap.pendingUnloads.clear();
|
||||||
}
|
}
|
||||||
} catch(RuntimeException e) {
|
} catch(RuntimeException e) {
|
||||||
ModernFix.LOGGER.error("Couldn't clear chunk data", e);
|
ModernFix.LOGGER.error("Couldn't clear chunk data", e);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package org.embeddedt.modernfix.common.mixin.perf.chunk_meshing;
|
||||||
import net.minecraft.client.renderer.chunk.SectionCompiler;
|
import net.minecraft.client.renderer.chunk.SectionCompiler;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
|
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
|
||||||
|
import org.embeddedt.modernfix.annotation.RequiresMod;
|
||||||
import org.embeddedt.modernfix.util.blockpos.SectionBlockPosIterator;
|
import org.embeddedt.modernfix.util.blockpos.SectionBlockPosIterator;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
@ -10,6 +11,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
@Mixin(value = SectionCompiler.class, priority = 2000)
|
@Mixin(value = SectionCompiler.class, priority = 2000)
|
||||||
@ClientOnlyMixin
|
@ClientOnlyMixin
|
||||||
|
@RequiresMod("!fluidlogged")
|
||||||
public class RebuildTaskMixin {
|
public class RebuildTaskMixin {
|
||||||
/**
|
/**
|
||||||
* @author embeddedt
|
* @author embeddedt
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user