Configurable light chunk sending
This commit is contained in:
@@ -274,4 +274,9 @@ public class AkarinGlobalConfig {
|
||||
private static void versionUpdateInterval() {
|
||||
versionUpdateInterval = getSeconds(getString("alternative.version-update-interval", "3600s")) * 1000; // 1 hour
|
||||
}
|
||||
|
||||
public static boolean sendLightOnlyChunkSection;
|
||||
private static void sendLightOnlyChunkSection() {
|
||||
sendLightOnlyChunkSection = getBoolean("core.send-light-only-chunk-sections", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package io.akarin.server.mixin.core;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import io.akarin.server.core.AkarinGlobalConfig;
|
||||
import net.minecraft.server.ChunkSection;
|
||||
|
||||
@Mixin(value = ChunkSection.class, remap = false)
|
||||
public abstract class MixinChunkSection {
|
||||
@Shadow private int nonEmptyBlockCount;
|
||||
|
||||
@Overwrite // PAIL: isEmpty
|
||||
public boolean a() {
|
||||
return AkarinGlobalConfig.sendLightOnlyChunkSection ? false : nonEmptyBlockCount == 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user