aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-02-18 23:00:01 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-02-18 23:00:01 +1000
commit548282e29dd4cc6fbf9071b509ef35cee5c99a7b (patch)
treedbb04f10254cd0222119b526d39d078a4284534b /src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
parentc13730a12f1e47bfc12ad8cf16043ef2093146e2 (diff)
downloadGT5-Unofficial-548282e29dd4cc6fbf9071b509ef35cee5c99a7b.tar.gz
GT5-Unofficial-548282e29dd4cc6fbf9071b509ef35cee5c99a7b.tar.bz2
GT5-Unofficial-548282e29dd4cc6fbf9071b509ef35cee5c99a7b.zip
^ Version Bump to PreRelease5.
% Updated CommandUtils.java. % Made AnimalFarm abstract, as it's currently an empty class. $ Fixed Recycling recipes not generating properly for all material components. They now get queued and run at the end of postInit().
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
index 98fb6050d4..72c09eed0a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
@@ -14,6 +14,7 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.array.AutoMap;
import gtPlusPlus.core.util.array.Pair;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
@@ -22,6 +23,16 @@ import net.minecraftforge.oredict.OreDictionary;
public class RecipeGen_Recycling implements Runnable {
+ public static AutoMap<Runnable> mQueuedRecyclingGenerators = new AutoMap<Runnable>();
+
+ public static void executeGenerators() {
+ if (mQueuedRecyclingGenerators.size() > 0) {
+ for (Runnable R : mQueuedRecyclingGenerators.values()) {
+ R.run();
+ }
+ }
+ }
+
final Material toGenerate;
public static Map<String, ItemStack> mNameMap;
@@ -30,14 +41,14 @@ public class RecipeGen_Recycling implements Runnable {
if (mNameMap == null){
mNameMap = this.getNameMap();
}
- if (mNameMap != null){
- generateRecipes(this.toGenerate);
- }
+ mQueuedRecyclingGenerators.put(this);
}
@Override
public void run() {
-
+ if (mNameMap != null){
+ generateRecipes(this.toGenerate);
+ }
}
public static void generateRecipes(final Material material) {