From 1fece28d41ca3cce1f251700bc101551d071fc99 Mon Sep 17 00:00:00 2001 From: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Date: Sun, 22 Jan 2023 04:02:09 +0000 Subject: Move event to server load --- src/main/java/com/github/technus/tectech/TecTech.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index cd51a532d3..80f7108e2d 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -36,7 +36,11 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Iterator; + +import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; +import pers.gwyog.gtneioreplugin.plugin.block.BlockDimensionDisplay; +import pers.gwyog.gtneioreplugin.plugin.block.ModBlocks; @Mod( modid = Reference.MODID, @@ -232,6 +236,12 @@ public class TecTech { pEvent.registerServerCommand(new ChargeCommand()); pEvent.registerServerCommand(new MassCommand()); } + + // This must be done after game load otherwise it fails. + eyeOfHarmonyRecipeStorage = new EyeOfHarmonyRecipeStorage(); + // The reason we do this is to force the fields inside the class to instantiate at world load so NEI + // displays properly. + eyeOfHarmonyRecipeStorage.recipeLookUp(new ItemStack(ModBlocks.blocks.get("Ow"))); } public static EyeOfHarmonyRecipeStorage eyeOfHarmonyRecipeStorage = null; @@ -240,8 +250,5 @@ public class TecTech { public void onServerAboutToStart(FMLServerAboutToStartEvent aEvent) { chunkDataHandler.clearData(); playerPersistence.clearData(); - - // This must be done after game load otherwise it fails. - eyeOfHarmonyRecipeStorage = new EyeOfHarmonyRecipeStorage(); } } -- cgit