Made it so that if two inputs are equal an Integr. Circuit (0) is added

This commit is contained in:
Johannes Gäßler 2017-08-01 11:20:55 +02:00
parent ecf7b4aa50
commit 4bfbdcdb1d
2 changed files with 18 additions and 13 deletions

View file

@ -602,24 +602,29 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
protected ItemStack[] getAllInputs() {
ItemStack[] rInputs = new ItemStack[mInputSlotCount];
int emptySlotLocation = -1;
ItemStack[] rInputs = new ItemStack[mInputSlotCount + 1];
boolean foundEmptySlotOrAreTwoInputsEqual = false;
boolean foundIntegratedCircuit = false;
for (int i = 0; i < mInputSlotCount; i++){
ItemStack currentInput = getInputAt(i);
if (emptySlotLocation == -1) {
if (currentInput == null) {
emptySlotLocation = i;
foundEmptySlotOrAreTwoInputsEqual = true;
continue;
}
}
rInputs[i] = currentInput;
if (!foundIntegratedCircuit && currentInput != null && currentInput.getItem() instanceof GT_IntegratedCircuit_Item) {
foundIntegratedCircuit = true;
}
rInputs[i] = currentInput;
if (!foundEmptySlotOrAreTwoInputsEqual) {
for (int j = 0; j < i; j++) {
if (GT_Utility.areStacksEqual(rInputs[i], rInputs[j])) {
foundEmptySlotOrAreTwoInputsEqual = true;
}
if (emptySlotLocation != -1 && !foundIntegratedCircuit) {
rInputs[emptySlotLocation] = GT_Utility.getIntegratedCircuit(0);
}
}
}
if (!foundIntegratedCircuit && foundEmptySlotOrAreTwoInputsEqual) {
rInputs[mInputSlotCount] = GT_Utility.getIntegratedCircuit(0);
}
return rInputs;
}

View file

@ -2542,8 +2542,8 @@ if(Loader.isModLoaded("Railcraft")){
GT_Values.RA.addUniversalDistillationRecipe(FluidRegistry.getFluidStack("potion.vinegar", 40), new FluidStack[]{Materials.AceticAcid.getFluid(5), Materials.Water.getFluid(35)}, GT_Values.NI, 20, 64);
GT_Values.RA.addMixerRecipe(Materials.Calcite.getDust(1), GT_Utility.getIntegratedCircuit(0), GT_Values.NI, GT_Values.NI, Materials.AceticAcid.getFluid(2000), Materials.CalciumAcetateSolution.getFluid(1000), GT_Values.NI, 240, 16);
GT_Values.RA.addMixerRecipe(Materials.Calcium.getDust(1), GT_Utility.getIntegratedCircuit(0), GT_Values.NI, GT_Values.NI, Materials.AceticAcid.getFluid(2000), Materials.CalciumAcetateSolution.getFluid(1000), GT_Values.NI, 80, 16);
GT_Values.RA.addMixerRecipe(Materials.Calcite.getDust(1), Materials.Empty.getCells(1), GT_Utility.getIntegratedCircuit(10), GT_Values.NI, Materials.AceticAcid.getFluid(2000), Materials.CalciumAcetateSolution.getFluid(1000), GT_Values.NI, 240, 16);
GT_Values.RA.addMixerRecipe(Materials.Calcium.getDust(1), Materials.Empty.getCells(1), GT_Utility.getIntegratedCircuit(10), GT_Values.NI, Materials.AceticAcid.getFluid(2000), Materials.CalciumAcetateSolution.getFluid(1000), GT_Values.NI, 80, 16);
GT_Values.RA.addMixerRecipe(Materials.Calcite.getDust(1), Materials.Empty.getCells(1), GT_Utility.getIntegratedCircuit(10), GT_Values.NI, Materials.AceticAcid.getFluid(2000), GT_Values.NF, Materials.CalciumAcetateSolution.getCells(1), 240, 16);
GT_Values.RA.addMixerRecipe(Materials.Calcium.getDust(1), Materials.Empty.getCells(1), GT_Utility.getIntegratedCircuit(10), GT_Values.NI, Materials.AceticAcid.getFluid(2000), GT_Values.NF, Materials.CalciumAcetateSolution.getCells(1), 80, 16);
GameRegistry.addSmelting(Materials.CalciumAcetateSolution.getCells(1), Materials.Acetone.getCells(1), 0);
GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(0), Materials.CalciumAcetateSolution.getFluid(1000), Materials.Acetone.getFluid(1000), 80, 30);
GT_Values.RA.addUniversalDistillationRecipe(Materials.CalciumAcetateSolution.getFluid(1000), new FluidStack[]{Materials.Acetone.getFluid(1000)}, Materials.Calcite.getDustSmall(3), 80, 480);