WIP Caching Hints and Caching Sampler

This commit is contained in:
Zoe Gidiere
2024-10-09 23:36:12 -06:00
parent 370b2e0122
commit 1ae0d1f867
11 changed files with 222 additions and 9 deletions
@@ -3,6 +3,9 @@ package com.dfsek.terra.lifecycle;
import ca.solostudios.strata.Versions;
import ca.solostudios.strata.parser.tokenizer.ParseException;
import ca.solostudios.strata.version.Version;
import com.dfsek.terra.api.util.reflection.ReflectionUtil;
import net.minecraft.MinecraftVersion;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.registry.Registry;
@@ -37,8 +40,15 @@ public abstract class LifecyclePlatform extends ModPlatform {
private static final AtomicReference<Registry<MultiNoiseBiomeSourceParameterList>> NOISE = new AtomicReference<>();
private static final AtomicReference<Registry<Enchantment>> ENCHANTMENT = new AtomicReference<>();
private static MinecraftServer server;
private int generationThreads;
public LifecyclePlatform() {
generationThreads = getGenerationThreadsWithReflection("com.ishland.c2me.base.common.GlobalExecutors", "GLOBAL_EXECUTOR_PARALLELISM", "C2ME");
if (generationThreads == 0) {
generationThreads = getGenerationThreadsWithReflection("ca.spottedleaf.moonrise.common.util.MoonriseCommon", "WORKER_THREADS", "Moonrise");
} if (generationThreads == 0) {
generationThreads = 1;
}
CommonPlatform.initialize(this);
load();
}
@@ -55,6 +65,8 @@ public abstract class LifecyclePlatform extends ModPlatform {
ENCHANTMENT.set(enchantmentRegistry);
}
@Override
public MinecraftServer getServer() {
return server;