9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 00:49:31 +00:00

Fast BiomeManager seed obfuscation

This commit is contained in:
HaHaWTH
2025-06-14 04:09:07 +14:00
parent 2d193b574b
commit 8e2099e975
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package org.dreeam.leaf.config.modules.opt;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
import org.dreeam.leaf.config.annotations.Experimental;
import java.util.concurrent.ThreadLocalRandom;
public class FastBiomeManagerSeedObfuscation extends ConfigModules {
public String getBasePath() {
return EnumConfigCategory.PERF.getBaseKeyName() + ".fast-biome-manager-seed-obfuscation";
}
@Experimental
public static boolean enabled = false;
public static long seedObfuscationKey = ThreadLocalRandom.current().nextLong();
@Override
public void onLoaded() {
enabled = config.getBoolean(getBasePath() + ".enabled", enabled,
config.pickStringRegionBased(
"""
**EXPERMIENTAL FEATURE**
Replace vanilla SHA-256 seed obfuscation in BiomeManager with XXHash.""",
"""
**实验性功能**
将原版 BiomeManager 的 SHA-256 种子混淆换成 XXHash."""));
seedObfuscationKey = config.getLong(getBasePath() + ".seed-obfuscation-key", seedObfuscationKey,
config.pickStringRegionBased(
"Seed obfuscation key for XXHash.",
"XXHash 的混淆种子."));
}
}