Fix lag spike when inserting compost into the Barrel for the first time

This commit is contained in:
thedarkcolour 2024-06-12 11:21:18 -07:00
parent b3e0130589
commit b2eef20dec
No known key found for this signature in database
GPG Key ID: 6599A8E0516C8F38
2 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,6 @@ import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.platform.NativeImage;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectSet;
@ -64,11 +63,12 @@ import java.util.stream.Collectors;
// ExDeorum comes with a precomputed list of vanilla colors, since textures don't exist on the server.
// However, modded textures usually DO exist on the server, so their colors can be computed by the server once
// and stored in a file which can be configured by the user after the fact.
// todo optimize
public class CompostColors {
public static final String VANILLA_COMPOST_COLORS_FILE = "vanilla_compost_colors.txt";
public static final Path COMPOST_COLORS_CONFIGS = Paths.get("config/exdeorum/compost_colors");
public static final Object2ObjectMap<Item, Vector3i> COLORS = new Object2ObjectOpenHashMap<>();
public static final Object2ObjectOpenHashMap<Item, Vector3i> COLORS = new Object2ObjectOpenHashMap<>();
public static final Vector3i DEFAULT_COLOR = new Vector3i(53, 168, 42);
public static void loadColors() {

View File

@ -171,6 +171,8 @@ public final class EventHandler {
}
private static void onCommonSetup(FMLCommonSetupEvent event) {
CompostColors.loadColors();
event.enqueueWork(() -> {
FluidInteractionRegistry.addInteraction(ForgeMod.LAVA_TYPE.get(), new FluidInteractionRegistry.InteractionInformation(
EFluids.WITCH_WATER_TYPE.get(),