Skip to content

Commit

Permalink
Stricter Registry Times
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Jan 8, 2024
1 parent dcaba09 commit 02d2f36
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 29 deletions.
13 changes: 2 additions & 11 deletions src/main/java/com/nomiceu/nomilabs/NomiLabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
dependencies = "required:forge@[14.23.5.2847,);"
+ "required-after:codechickenlib@[3.2.3,);"
+ "required-after:groovyscript@[0.6.0,);"
+ "required-after:gregtech;"
+ "required-after:gregtech@[2.8,);"
+ "required-after:packmode;"
+ "after:crafttweaker@[4.1.20,);"
+ "after:appliedenergistics2;"
+ "after:jei@[4.15.0,);"
+ "after:theoneprobe;")
Expand All @@ -36,16 +37,6 @@ public void preInit(FMLPreInitializationEvent event) {
CommonProxy.preInit();
}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
CommonProxy.postInit();
}

@EventHandler
public void init(FMLInitializationEvent event) {
CommonProxy.init();
}

@EventHandler
public void serverStopped(FMLServerStoppedEvent event) {
DataFixerHandler.close();
Expand Down
21 changes: 7 additions & 14 deletions src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
@SuppressWarnings("unused")
public class CommonProxy {
public static void preInit() {
LabsModeHelper.check();

LabsCreativeTabs.preInit();

if (LabsConfig.content.customContent.enableItems)
Expand All @@ -56,24 +58,13 @@ public static void preInit() {

LabsSounds.register();
LabsRemappers.preInit();
}

public static void init() {
LabsModeHelper.check();
LabsRecipeMaps.init();
DataFixerHandler.init();
}

public static void postInit() {
if (LabsConfig.content.gtCustomContent.enableOldMultiblocks)
LabsMultiblocks.initOld();
if (LabsConfig.content.gtCustomContent.enableNewMultiblocks)
LabsMultiblocks.initNew();
LabsRecipeMaps.preInit();
LabsMultiblocks.preInit();

if (LabsConfig.modIntegration.enableTOPIntegration && Loader.isModLoaded(LabsValues.TOP_MODID))
TOPTooltipManager.registerProviders();

//com.nomiceu.nomilabs.recipe.LabsTestRecipes.postInit();
DataFixerHandler.preInit();
}

@SubscribeEvent
Expand Down Expand Up @@ -107,6 +98,8 @@ public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
PerfectGemsCutterRecipes.initRecipes();
if (LabsConfig.content.customContent.enableComplexRecipes && LabsItems.HAND_FRAMING_TOOL != null)
event.getRegistry().register(new HandFramingRecipe(LabsNames.makeLabsName("hand_framing_recipe")));

//com.nomiceu.nomilabs.recipe.LabsTestRecipes.postInit();
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class LabsRecipeMaps {
public static RecipeMap<SimpleRecipeBuilder> DME_SIM_CHAMBER_RECIPES;
public static RecipeMap<SimpleRecipeBuilder> GREENHOUSE_RECIPES;

public static void init() {
public static void preInit() {
MICROVERSE_RECIPES = new ArrayList<>();

for (int i = 0; i < 3; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nomiceu.nomilabs.gregtech.multiblock.registry;

import com.nomiceu.nomilabs.config.LabsConfig;
import com.nomiceu.nomilabs.gregtech.multiblock.*;
import com.nomiceu.nomilabs.util.LabsNames;
import gregtech.common.metatileentities.MetaTileEntities;
Expand All @@ -23,7 +24,14 @@ public class LabsMultiblocks {
public static MetaTileEntityUniversalCrystalizer UNIVERSAL_CRYSTALIZER;
public static MetaTileEntityDMESimChamber DME_SIM_CHAMBER;

public static void initOld() {
public static void preInit() {
if (LabsConfig.content.gtCustomContent.enableOldMultiblocks)
initOld();
if (LabsConfig.content.gtCustomContent.enableNewMultiblocks)
initNew();
}

private static void initOld() {
MICROVERSE_1 = MetaTileEntities.registerMetaTileEntity(32100, new MetaTileEntityMicroverseProjector.Microverse1(LabsNames.makeLabsName("microverse_projector_1")));
MICROVERSE_2 = MetaTileEntities.registerMetaTileEntity(32101, new MetaTileEntityMicroverseProjector.Microverse2(LabsNames.makeLabsName("microverse_projector_2")));
MICROVERSE_3 = MetaTileEntities.registerMetaTileEntity(32102, new MetaTileEntityMicroverseProjector.Microverse3(LabsNames.makeLabsName("microverse_projector_3")));
Expand All @@ -39,7 +47,7 @@ public static void initOld() {

DME_SIM_CHAMBER = MetaTileEntities.registerMetaTileEntity(32108, new MetaTileEntityDMESimChamber(LabsNames.makeLabsName("dme_sim_chamber")));
}
public static void initNew() {
private static void initNew() {
GREENHOUSE = MetaTileEntities.registerMetaTileEntity(32109, new MetaTileEntityGreenhouse(LabsNames.makeLabsName("greenhouse")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class DataFixerHandler {

public static Map<Integer, ResourceLocation> blockIdToRlMap;

public static void init() {
public static void preInit() {
LabsFixes.init();
CompoundDataFixer fmlFixer = FMLCommonHandler.instance().getDataFixer();

Expand Down

0 comments on commit 02d2f36

Please sign in to comment.