Remove linearv2 support as it's no longer maintained
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s

This commit is contained in:
2026-08-13 00:37:44 +08:00
parent 586925cde2
commit ce1a1a3fb4
3 changed files with 2 additions and 643 deletions
@@ -1,6 +1,5 @@
package io.nanachiyo0721.shiroha.config.modules.function;
import abomination.LinearRegionFile;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.IllegalFormatConversionExceptionWithOrigin;
@@ -19,26 +18,17 @@ import java.util.Set;
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "region_format")
public class RegionFormatConfig implements IConfigModule {
@HotReloadUnsupported
@ConfigInfo(name = "format", allowAutoReset = false, comments = "Available choices: MCA, B_LINEAR, LINEAR_V2")
@ConfigInfo(name = "format", allowAutoReset = false, comments = "Available choices: MCA, B_LINEAR")
public static EnumRegionFormat regionFormat = EnumRegionFormat.MCA;
@HotReloadUnsupported
@ConfigInfo(name = "linear_compression_level", comments = "Decides the compression level of the region file(Only works for LINEAR_V2 and B_LINEAR)")
@ConfigInfo(name = "linear_compression_level", comments = "Decides the compression level of the region file(Only works for B_LINEAR)")
public static int linearCompressionLevel = 1;
@HotReloadUnsupported
@ConfigInfo(name = "linear_io_thread_count", comments = "Decides the worker thread count of linear(Only works for LINEAR_V2)")
public static int linearIoThreadCount = 6;
@HotReloadUnsupported
@ConfigInfo(name = "linear_io_flush_delay_ms", comments = "Decides when it will be flushed to the region file when it has been marked to save for n(default is 100) milliseconds(Only works for LINEAR_V2)")
public static int linearIoFlushDelayMs = 100;
@HotReloadUnsupported
@ConfigInfo(name = "blinear_io_flush_delay_ms", comments = "Decides when it will be flushed to the region file when there has been no write operations for n(default is 3000) milliseconds(Only works for B_LINEAR)")
public static int blinearIoFlushDelayMs = 3000;
@HotReloadUnsupported
@ConfigInfo(name = "blinear_io_thread_count", comments = "Decides the worker thread count of buffered linear(Only works for B_LINEAR)")
public static int blinearIoThreadCount = 6;
@HotReloadUnsupported
@ConfigInfo(name = "linear_use_virtual_thread", comments = "Decides if it could use virtual threads for linear format(Only works for LINEAR_V2)")
public static boolean linearUseVirtualThread = true;
@DoNotLoad
public static BufferedLinearRegionFileFlusher blinearFlusher = null;
@@ -53,14 +43,6 @@ public class RegionFormatConfig implements IConfigModule {
}
}
if (regionFormat == EnumRegionFormat.LINEAR_V2) {
checkCompressionLevel();
LinearRegionFile.SAVE_DELAY_MS = linearIoFlushDelayMs;
LinearRegionFile.SAVE_THREAD_MAX_COUNT = linearIoThreadCount;
LinearRegionFile.USE_VIRTUAL_THREAD = linearUseVirtualThread;
}
if (regionFormat == EnumRegionFormat.B_LINEAR) {
blinearFlusher = new BufferedLinearRegionFileFlusher(blinearIoThreadCount, 20, blinearIoFlushDelayMs);
@@ -1,6 +1,5 @@
package io.nanachiyo0721.shiroha.enums;
import abomination.LinearRegionFile;
import io.nanachiyo0721.shiroha.config.modules.function.RegionFormatConfig;
import io.nanachiyo0721.shiroha.data.BufferedLinearRegionFile;
import io.nanachiyo0721.shiroha.utils.RegionFileFactory;
@@ -8,7 +7,6 @@ import net.minecraft.world.level.chunk.storage.RegionFile;
public enum EnumRegionFormat {
MCA("mca", (info) -> new RegionFile(info.info(), info.filePath(), info.folder(), info.sync())),
LINEAR_V2("linear", (info) -> new LinearRegionFile(info.info(), info.filePath(), info.folder(), info.sync(), RegionFormatConfig.linearCompressionLevel)),
B_LINEAR("b_linear", (info) -> new BufferedLinearRegionFile(info.filePath(), RegionFormatConfig.linearCompressionLevel, RegionFormatConfig.blinearFlusher));
private final String argument;