aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/handler
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-07-02 00:36:10 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-07-02 00:36:10 +1000
commit81360a320daf83530cc9260068e13111759d2212 (patch)
tree0db5bdb7fa09fd91a8dfc8b43801daf5a2faf53f /src/Java/gtPlusPlus/core/handler
parentafa03ba1b0475ad6b2caeeb1af6f7ed2f8a76e0a (diff)
downloadGT5-Unofficial-81360a320daf83530cc9260068e13111759d2212.tar.gz
GT5-Unofficial-81360a320daf83530cc9260068e13111759d2212.tar.bz2
GT5-Unofficial-81360a320daf83530cc9260068e13111759d2212.zip
% Hopefully improved recipe loading by several factors.
% Re-arranged spawner code during loading. $ Hopefully recipe Creative Tabs issues. $ Fixed profession of one of the new villagers.
Diffstat (limited to 'src/Java/gtPlusPlus/core/handler')
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java34
-rw-r--r--src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java4
2 files changed, 32 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index 2ec0c9abdd..810abdbc32 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -8,6 +8,7 @@ import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.common.compat.*;
import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
@@ -55,7 +56,7 @@ public class COMPAT_HANDLER {
911
to
940
- */
+ */
new RECIPES_LaserEngraver();
new RECIPES_Extruder();
@@ -115,7 +116,7 @@ public class COMPAT_HANDLER {
GregtechThreadedBuffers.run();
GregtechIndustrialMixer.run();
GregtechCustomHatches.run();
-
+
//New Horizons Content
NewHorizonsAccelerator.run();
}
@@ -181,7 +182,7 @@ public class COMPAT_HANDLER {
for (Set<RunnableWithInfo<Material>> m : MaterialGenerator.mRecipeMapsToGenerate) {
for (RunnableWithInfo<Material> r : m) {
try {
- r.run();
+ r.run();
}
catch (Throwable t) {
t.printStackTrace();
@@ -191,4 +192,31 @@ public class COMPAT_HANDLER {
}
RecipeGen_Recycling.executeGenerators();
}
+
+ public static final AutoMap<RunnableWithInfo<String>> mRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
+ public static final AutoMap<RunnableWithInfo<String>> mGtRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
+
+ public static void runQueuedRecipes() {
+ //Add autogenerated Recipes from Item Components
+ for (RunnableWithInfo<String> m : mRecipesToGenerate) {
+ try {
+ m.run();
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] "+m.getInfoData()+" recipe failed to generated.");
+ }
+
+ }
+ for (RunnableWithInfo<String> m : mGtRecipesToGenerate) {
+ try {
+ m.run();
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] "+m.getInfoData()+" recipe failed to generated.");
+ }
+
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
index cbc8518fd7..4192e71091 100644
--- a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -15,15 +15,13 @@ public class RegistrationHandler {
private final static void init(){
RECIPES_Tools.loadRecipes();
+ RECIPES_General.loadRecipes();
RECIPES_Machines.loadRecipes();
RECIPES_Shapeless.loadRecipes();
RECIPES_MachineComponents.loadRecipes();
RECIPE_Batteries.loadRecipes();
- RECIPES_General.loadRecipes();
- //RECIPES_MTWRAPPER.run();
Logger.INFO("Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
COMPAT_HANDLER.areInitItemsLoaded = true;
- //Utils.LOG_INFO("MT Loaded: "+RECIPES_MTWRAPPER.MT_RECIPES_LOADED+" MT Failed: "+RECIPES_MTWRAPPER.MT_RECIPES_FAILED);
}
}