diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-05-24 07:01:27 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-05-24 07:01:27 +1000 |
commit | b44d061f6ca95236a873bb0835d0e2fd77b96851 (patch) | |
tree | 818807e7b6c95854017a87f3f9384fd32b04043e /src/Java/gtPlusPlus/core/util | |
parent | c40825297fc1008c72bfebca09af9aabe15c2832 (diff) | |
download | GT5-Unofficial-b44d061f6ca95236a873bb0835d0e2fd77b96851.tar.gz GT5-Unofficial-b44d061f6ca95236a873bb0835d0e2fd77b96851.tar.bz2 GT5-Unofficial-b44d061f6ca95236a873bb0835d0e2fd77b96851.zip |
$ Tried to fix GT ItemList values being called too early when certain mods are loaded, causing them to not be loaded when GT++ is running PreInit().
$ Rewrote system that Autogenerates Recipes for Materials, migrating all recipes to be generated in PostInit() stage now.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java | 10 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java index b5a53cce36..f7f3906d18 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java @@ -282,7 +282,7 @@ public class FluidUtils { 3, 10000, temp, - ItemList.Cell_Empty.get(1L, new Object[0]), + ItemUtils.getEmptyCell(), 1000); } return null; @@ -397,7 +397,7 @@ public class FluidUtils { if (aStack.getItem().hasContainerItem(aStack)) { return aStack.getItem().getContainerItem(aStack); } - if (equal(aStack, ItemList.Cell_Empty.get(1), true)) { + if (equal(aStack, ItemUtils.getEmptyCell(), true)) { return null; } if (aCheckIFluidContainerItems && (aStack.getItem() instanceof IFluidContainerItem) && (((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0)) { @@ -436,7 +436,7 @@ public class FluidUtils { 4, MeltingPoint, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1), - ItemList.Cell_Empty.get(1L, new Object[0]), + ItemUtils.getEmptyCell(), 1000); //Disable this, not sure why it exists //TODO @@ -481,7 +481,7 @@ public class FluidUtils { 4, MeltingPoint, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1), - ItemList.Cell_Empty.get(1L, new Object[0]), + ItemUtils.getEmptyCell(), 1000); if (dustStack != null){ @@ -522,7 +522,7 @@ public class FluidUtils { 4, MeltingPoint, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1), - ItemList.Cell_Empty.get(1L, new Object[0]), + ItemUtils.getEmptyCell(), 1000); } else { diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index f9eb9de310..43fc6d3cc4 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -11,6 +11,7 @@ import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; @@ -94,7 +95,10 @@ public class ItemUtils { return getEmptyCell(1); } - public static ItemStack getEmptyCell(int i){ + public static ItemStack getEmptyCell(int i){ + if (ItemList.Cell_Empty.hasBeenSet()) { + return ItemList.Cell_Empty.get(1L, new Object[0]); + } final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", i, 0); return temp != null ? temp : null; } @@ -378,7 +382,7 @@ public class ItemUtils { }; } - RecipeGen_DustGeneration.generateRecipes(material); + new RecipeGen_DustGeneration(material); return output; } |