diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2018-05-22 17:44:06 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2018-05-22 17:44:06 +1000 |
commit | 65f96ccd3a3e1fbecb46c6e334a574d73d1ad017 (patch) | |
tree | 5de54848fd6c9d7ff5bb7a05c59aeaa9850e3569 /src/Java | |
parent | b439f9c8ae23b9ceed8dd73d540afb6b1192f4d7 (diff) | |
download | GT5-Unofficial-65f96ccd3a3e1fbecb46c6e334a574d73d1ad017.tar.gz GT5-Unofficial-65f96ccd3a3e1fbecb46c6e334a574d73d1ad017.tar.bz2 GT5-Unofficial-65f96ccd3a3e1fbecb46c6e334a574d73d1ad017.zip |
% Updated Mass Fabricator Tooltip.
$ Possibly fixed invalid recipes generating in the Large Machines.
Diffstat (limited to 'src/Java')
3 files changed, 47 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index dcb3baee8e..d992539374 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -215,14 +215,18 @@ public class GTplusplus implements ActionListener { //Large Centrifuge generation for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList) { if (x != null) { - CORE.RA.addMultiblockCentrifugeRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + if (ItemUtils.checkForInvalidItems(x.mInputs)) { + CORE.RA.addMultiblockCentrifugeRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + } } } //Large Electrolyzer generation for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList) { if (x != null) { - CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + if (ItemUtils.checkForInvalidItems(x.mInputs)) { + CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + } } } @@ -234,7 +238,9 @@ public class GTplusplus implements ActionListener { FluidStack[] y = new FluidStack[len + 1]; int slot = y.length - 1; y[slot] = FluidUtils.getFluidStack("cryotheum", mTime); - CORE.RA.addAdvancedFreezerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + if (ItemUtils.checkForInvalidItems(x.mInputs)) { + CORE.RA.addAdvancedFreezerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + } } } @@ -247,7 +253,7 @@ public class GTplusplus implements ActionListener { mapKey++; } }*/ - + } protected void dumpGtRecipeMap(final GT_Recipe_Map r) { diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index a85102005e..cf98ec81ff 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -764,5 +764,37 @@ public class ItemUtils { return blockName; } } + /** + * + * @param mInputs + * @return {@link Boolean} - True if {@link ItemStack}[] only contains valid items. + */ + public static boolean checkForInvalidItems(ItemStack[] mInputs) { + if (mInputs == null || mInputs.length == 0) { + return false; + } + for (ItemStack stack : mInputs) { + if (stack != null) { + if (stack.getItem() != null) { + if (stack.getItem() == ModItems.AAA_Broken || stack.getItem().getClass() == ModItems.AAA_Broken.getClass()){ + return false; + } + else if (stack.getItem() == ModItems.ZZZ_Empty || stack.getItem().getClass() == ModItems.ZZZ_Empty.getClass()){ + return false; + } + else { + continue; + } + } + else { + continue; + } + } + else { + continue; + } + } + return true; + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 4a57688d73..b226b1f5f1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -86,6 +86,11 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo return new String[]{ "Controller Block for the Matter Fabricator", "Produces UU-Matter from UU-Amplifier", + "Use numbered circuits in GUI slot to change mode", + "[19] Junk Items to Scrap", + "[20] Junk Items to UU-A", + "[21] Scrap to UU-A", + "[22] Produce UU-M", "Size(WxHxD): 5x4x5, Controller (Bottom center)", "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)", "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)", |