diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2018-10-05 18:46:54 +0200 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2018-10-05 18:46:54 +0200 |
commit | e10456295def2ea5bacede8ab954524aa03165a4 (patch) | |
tree | cce8ebd62bc0674b9e227cbc640305febda2af2b /src/main/java/gregtech/api/util/GT_Recipe.java | |
parent | d87d10242ad58d9a59c525e7e61a282e9381b8f9 (diff) | |
download | GT5-Unofficial-e10456295def2ea5bacede8ab954524aa03165a4.tar.gz GT5-Unofficial-e10456295def2ea5bacede8ab954524aa03165a4.tar.bz2 GT5-Unofficial-e10456295def2ea5bacede8ab954524aa03165a4.zip |
try for force unification of assembler recipes
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_Recipe.java')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Recipe.java | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 6750fb895f..234dc994d8 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -19,6 +19,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
+import net.minecraftforge.oredict.OreDictionary;
import java.util.*;
@@ -1295,24 +1296,71 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * Special Class for Assembler handling.
*/
public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map {
+
public GT_Recipe_Map_Assembler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
}
@Override
public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+
+ GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, true, aVoltage, aFluids, aSpecialSlot, aInputs);
+/*
+
+
+ Doesnt work, keep it as a reminder tho
+
+ if (rRecipe == null){
+ Set<ItemStack> aInputs2 = new TreeSet<ItemStack>();
+ for (ItemStack aInput : aInputs) {
+ aInputs2.add(aInput);
+ }
+
+ for (ItemStack aInput : aInputs) {
+ aInputs2.remove(aInput);
+ int[] oredictIDs = OreDictionary.getOreIDs(aInput);
+ if ( oredictIDs.length > 1){
+ for (final int i : oredictIDs){
+ final ItemStack[] oredictIS = (ItemStack[]) OreDictionary.getOres(OreDictionary.getOreName(i)).toArray();
+ if (oredictIS != null && oredictIS.length > 1){
+ for (final ItemStack IS : oredictIS){
+ aInputs2.add(IS);
+ ItemStack[] temp = (ItemStack[]) aInputs2.toArray();
+ rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot,temp);
+ if(rRecipe!= null){
+ break;
+ }
+ else {
+ aInputs2.remove(IS);
+ }
+ }
+ if(rRecipe!= null)
+ break;
+ }
+ }
+ if(rRecipe!= null)
+ break;
+ }else
+ aInputs2.add(aInput);
+ if(rRecipe!= null)
+ break;
+ }
+ }
+*/
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe == null || !GregTech_API.sPostloadFinished)
return rRecipe;
+
for (ItemStack aInput : aInputs) {
if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, false, true)) {
rRecipe = rRecipe.copy();
rRecipe.mCanBeBuffered = false;
rRecipe.mOutputs[0].setTagCompound(aInput.getTagCompound());
}
+
}
return rRecipe;
}
+
}
/**
|