Add chunk saving fix
This commit is contained in:
parent
36cc832b9d
commit
21d559ab94
|
|
@ -60,7 +60,7 @@ minecraft {
|
|||
// Recommended logging level for the console
|
||||
// You can set various levels here.
|
||||
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
property 'forge.logging.console.level', 'info'
|
||||
|
||||
|
||||
mods {
|
||||
|
|
@ -140,6 +140,10 @@ dependencies {
|
|||
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
|
||||
|
||||
runtimeOnly fg.deobf("curse.maven:lazydfu-460819:${lazydfu_version}")
|
||||
runtimeOnly fg.deobf("curse.maven:roadrunner-529754:3683120")
|
||||
runtimeOnly fg.deobf("curse.maven:starlight-529754:3683120")
|
||||
runtimeOnly fg.deobf("curse.maven:rubidium-574856:3949659")
|
||||
runtimeOnly fg.deobf("curse.maven:noexperimental-407174:3188120")
|
||||
|
||||
runtimeOnly fg.deobf("mekanism:Mekanism:${mekanism_version}")// core
|
||||
runtimeOnly fg.deobf("mekanism:Mekanism:${mekanism_version}:generators")// Mekanism: Generators
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class ModernFixConfig {
|
|||
this.addMixinRule("perf.parallelize_model_loading", true);
|
||||
this.addMixinRule("perf.trim_model_caches", true);
|
||||
this.addMixinRule("bugfix.concurrency", true);
|
||||
this.addMixinRule("bugfix.edge_chunk_not_saved", true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package org.embeddedt.modernfix.mixin.bugfix.edge_chunk_not_saved;
|
||||
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkPrimer;
|
||||
import net.minecraft.world.chunk.ChunkPrimerWrapper;
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
import net.minecraft.world.server.ChunkHolder;
|
||||
import net.minecraft.world.server.ChunkManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/* https://github.com/SuperCoder7979/chunksavingfix-fabric/blob/main/src/main/java/supercoder79/chunksavingfix/mixin/MixinThreadedAnvilChunkStorage.java */
|
||||
@Mixin(ChunkManager.class)
|
||||
public class ChunkManagerMixin {
|
||||
// TODO: hits both at the moment- check and re-evaluate
|
||||
@ModifyArg(method = "saveAllChunks(Z)V", at = @At(value = "INVOKE", target = "Ljava/util/stream/Stream;filter(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", ordinal = 0), require = 0)
|
||||
private Predicate<ChunkHolder> alwaysAccessibleFlush(Predicate<ChunkHolder> chunkHolder) {
|
||||
return c -> true;
|
||||
}
|
||||
@ModifyArg(method = "saveAllChunks(Z)V", at = @At(value = "INVOKE", target = "Ljava/util/stream/Stream;filter(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", ordinal = 1), require = 0)
|
||||
private Predicate<IChunk> allowProtoChunkFlush(Predicate<IChunk> chunk) {
|
||||
return c -> c instanceof ChunkPrimer || c instanceof ChunkPrimerWrapper || c instanceof Chunk;
|
||||
}
|
||||
|
||||
@ModifyArg(method = "saveAllChunks(Z)V", at = @At(value = "INVOKE", target = "Ljava/util/stream/Stream;filter(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", ordinal = 3), require = 0)
|
||||
private Predicate<ChunkHolder> alwaysAccessible(Predicate<ChunkHolder> chunkHolder) {
|
||||
return c -> true;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
"compatibilityLevel": "JAVA_8",
|
||||
"refmap": "modernfix.refmap.json",
|
||||
"mixins": [
|
||||
"bugfix.edge_chunk_not_saved.ChunkManagerMixin",
|
||||
"feature.measure_time.MinecraftMixin",
|
||||
"perf.remove_biome_temperature_cache.BiomeMixin",
|
||||
"perf.resourcepacks.ModFileResourcePackMixin",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user