diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2018-02-18 23:00:01 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2018-02-18 23:00:01 +1000 |
commit | 548282e29dd4cc6fbf9071b509ef35cee5c99a7b (patch) | |
tree | dbb04f10254cd0222119b526d39d078a4284534b /src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java | |
parent | c13730a12f1e47bfc12ad8cf16043ef2093146e2 (diff) | |
download | GT5-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.java | 19 |
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) { |