More machine fixes, and more new bugs

This commit is contained in:
TheDarkDnKTv 2021-02-02 10:12:38 +02:00
parent 10c510df35
commit e00e4bc37f
19 changed files with 338 additions and 326 deletions

View file

@ -534,13 +534,11 @@ public abstract class MetaTileEntity implements IMetaTileEntity {
if (setStackToZeroInsteadOfNull(aIndex)) if (setStackToZeroInsteadOfNull(aIndex))
rStack.stackSize = 0; rStack.stackSize = 0;
else else
// setInventorySlotContents(aIndex, null);
getBaseMetaTileEntity().setInventorySlotContents(aIndex, null); getBaseMetaTileEntity().setInventorySlotContents(aIndex, null);
} else { } else {
rStack = rStack.splitStack(aAmount); rStack = rStack.splitStack(aAmount);
if (rStack.stackSize == 0) { if (rStack.stackSize == 0) {
if (!setStackToZeroInsteadOfNull(aIndex)) if (!setStackToZeroInsteadOfNull(aIndex))
// setInventorySlotContents(aIndex, null);
getBaseMetaTileEntity().setInventorySlotContents(aIndex, null); getBaseMetaTileEntity().setInventorySlotContents(aIndex, null);
} }
} }

View file

@ -38,7 +38,7 @@ public class GT_MetaTileEntity_E_Furnace extends GT_MetaTileEntity_BasicMachine
if (mInventory[2].stackSize == 0) mInventory[2] = null; if (mInventory[2].stackSize == 0) mInventory[2] = null;
// It shall cook at 3 EU/t, if this Machine is overclocked then it will consume more // It shall cook at 3 EU/t, if this Machine is overclocked then it will consume more
// The time it usually needs, the Heating Coils re decreasing this Time, and if the Machine is overclocked, then it gets processed faster // The time it usually needs, the Heating Coils re decreasing this Time, and if the Machine is overclocked, then it gets processed faster
return new Recipe(mInventory[2], null, output, null, null, null, 130 / (1+mHeatingCoilTier), 3, 0); return new Recipe(mInventory[2], null, output, null, null, null, 130 / (1+mHeatingCoilTier), 3, 0, true);
} }
return null; return null;

View file

@ -155,12 +155,13 @@ public abstract class BasicFluidWorkable extends GT_MetaTileEntity_BasicTank imp
@Override @Override
public boolean spaceForOutput(Recipe recipe) { public boolean spaceForOutput(Recipe recipe) {
if (recipe.getOutputs().length <= getOutputSlots().length) { ItemStack[] outputs = recipe.getOutputs();
if (outputs.length <= getOutputSlots().length) {
List<ItemStack> slots = new ArrayList<>(); List<ItemStack> slots = new ArrayList<>();
for (int i : getOutputSlots()) slots.add(mInventory[i]); for (int i : getOutputSlots()) slots.add(mInventory[i]);
for (int i = 0; i < recipe.getOutputs().length && i < slots.size(); i++) { for (int i = 0; i < outputs.length && i < slots.size(); i++) {
if (slots.get(i) != null && recipe.getOutputs()[i] != null) { if (slots.get(i) != null && outputs[i] != null) {
if (!GT_Utility.areStacksEqual(slots.get(i), recipe.getOutputs()[i]) || slots.get(i).stackSize + recipe.getOutputs()[i].stackSize > slots.get(i).getMaxStackSize()) { if (!GT_Utility.areStacksEqual(slots.get(i), outputs[i]) || slots.get(i).stackSize + outputs[i].stackSize > slots.get(i).getMaxStackSize()) {
return false; return false;
} }
} }
@ -173,9 +174,9 @@ public abstract class BasicFluidWorkable extends GT_MetaTileEntity_BasicTank imp
@Override @Override
public Map<String, List<Object>> getInfoData() { public Map<String, List<Object>> getInfoData() {
return InfoBuilder.create() return InfoBuilder.create()
.newKey("sensor.progress.percentage", recipeLogic.getProgressTime() * 100.0D / recipeLogic.getMaxProgressTime()) .newKey("sensor.progress.percentage", recipeLogic.getDisplayProgress() * 100.0D / recipeLogic.getDisplayMaxProgress())
.newKey("sensor.progress.secs", recipeLogic.getProgressTime() / 20) .newKey("sensor.progress.secs", recipeLogic.getDisplayProgress() / 20)
.newKey("sensor.progress.secs.1", recipeLogic.getMaxProgressTime() / 20) .newKey("sensor.progress.secs.1", recipeLogic.getDisplayMaxProgress() / 20)
.build(); .build();
} }

View file

@ -33,11 +33,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends MetaTileEntity impl
public GT_MetaTileEntity_BasicMachine(int aID, String aName, List<Recipe> recipeMap) { public GT_MetaTileEntity_BasicMachine(int aID, String aName, List<Recipe> recipeMap) {
super(aID, aName); super(aID, aName);
recipeLogic = new RecipeLogic(recipeMap, this); initRecipeLogic(recipeMap);
} }
public GT_MetaTileEntity_BasicMachine(List<Recipe> recipeMap) { public GT_MetaTileEntity_BasicMachine(List<Recipe> recipeMap) {
recipeLogic = new RecipeLogic(recipeMap, this); initRecipeLogic(recipeMap);
} }
@Override public boolean isSimpleMachine() {return false;} @Override public boolean isSimpleMachine() {return false;}
@ -67,6 +67,10 @@ public abstract class GT_MetaTileEntity_BasicMachine extends MetaTileEntity impl
@Override public boolean isLiquidInput (byte aSide) {return aSide != mMainFacing;} @Override public boolean isLiquidInput (byte aSide) {return aSide != mMainFacing;}
@Override public boolean isLiquidOutput(byte aSide) {return aSide != mMainFacing;} @Override public boolean isLiquidOutput(byte aSide) {return aSide != mMainFacing;}
protected void initRecipeLogic(List<Recipe> recipeMap) {
recipeLogic = new RecipeLogic(recipeMap, this);
}
@Override @Override
public void saveNBTData(NBTTagCompound aNBT) { public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setBoolean("bOutput", bOutput); aNBT.setBoolean("bOutput", bOutput);
@ -133,12 +137,13 @@ public abstract class GT_MetaTileEntity_BasicMachine extends MetaTileEntity impl
@Override @Override
public boolean spaceForOutput(Recipe recipe) { public boolean spaceForOutput(Recipe recipe) {
if (recipe.getOutputs().length <= getOutputSlots().length) { ItemStack[] outputs = recipe.getOutputs();
if (outputs.length <= getOutputSlots().length) {
List<ItemStack> slots = new ArrayList<>(); List<ItemStack> slots = new ArrayList<>();
for (int i : getOutputSlots()) slots.add(mInventory[i]); for (int i : getOutputSlots()) slots.add(mInventory[i]);
for (int i = 0; i < slots.size(); i++) { for (int i = 0; i < outputs.length && i < slots.size(); i++) {
if (slots.get(i) != null && recipe.getOutputs()[i] != null) { if (slots.get(i) != null && outputs[i] != null) {
if (!GT_Utility.areStacksEqual(slots.get(i), recipe.getOutputs()[i]) || slots.get(i).stackSize + recipe.getOutputs()[i].stackSize > slots.get(i).getMaxStackSize()) { if (!GT_Utility.areStacksEqual(slots.get(i), outputs[i]) || slots.get(i).stackSize + outputs[i].stackSize > slots.get(i).getMaxStackSize()) {
return false; return false;
} }
} }
@ -275,9 +280,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends MetaTileEntity impl
@Override @Override
public Map<String, List<Object>> getInfoData() { public Map<String, List<Object>> getInfoData() {
return InfoBuilder.create() return InfoBuilder.create()
.newKey("sensor.progress.percentage", recipeLogic.getProgressTime() * 100.0D / recipeLogic.getMaxProgressTime()) .newKey("sensor.progress.percentage", recipeLogic.getDisplayProgress() * 100.0D / recipeLogic.getDisplayMaxProgress())
.newKey("sensor.progress.secs", recipeLogic.getProgressTime() / 20) .newKey("sensor.progress.secs", recipeLogic.getDisplayProgress() / 20)
.newKey("sensor.progress.secs.1", recipeLogic.getMaxProgressTime() / 20) .newKey("sensor.progress.secs.1", recipeLogic.getDisplayMaxProgress() / 20)
.build(); .build();
} }

View file

@ -24,6 +24,9 @@ import java.util.Set;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.MultimapBuilder.ListMultimapBuilder;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -44,8 +47,8 @@ public class Recipe {
/** It is an IdentityHashMap, because it uses a List as Key, and since that List changes (and therefore the Result of the equals Method), the Key is not secure, while the Identity is. */ /** It is an IdentityHashMap, because it uses a List as Key, and since that List changes (and therefore the Result of the equals Method), the Key is not secure, while the Identity is. */
private static final IdentityHashMap<List<Recipe>, Map<Integer, List<Recipe>>> RECIPE_MAPPINGS = new IdentityHashMap<>(); private static final IdentityHashMap<List<Recipe>, Map<Integer, List<Recipe>>> RECIPE_MAPPINGS = new IdentityHashMap<>();
public ItemStack[][] mInputs; public ItemStack[][] mInputs; // FIXME create ingredient class and make sure counting wildcard / nbt while matching recipes
public ItemStack[] mOutputs; public ItemStack[] mOutputs; // FIXME add precise and oredict recipes
public int mDuration; public int mDuration;
public int mEUt; public int mEUt;
public int mStartEU; public int mStartEU;
@ -96,11 +99,11 @@ public class Recipe {
boolean success = this.match(key -> decreaseList.add(key), slotStacks.keySet()); boolean success = this.match(key -> decreaseList.add(key), slotStacks.keySet());
if (success && decrease) { if (success && decrease) {
Map<ItemStackKey, Integer> slotAligment = slotStacks.entrySet().stream() ListMultimap<ItemStackKey, Integer> slotAligment = ListMultimapBuilder.hashKeys().arrayListValues().build();
.collect(Collectors.toMap(e -> ItemStackKey.from(e.getKey()), e -> e.getValue())); slotStacks.entrySet().forEach(e -> slotAligment.put(ItemStackKey.from(e.getKey()), e.getValue()));
for (ItemStackKey item : decreaseList) { for (ItemStackKey recipeKey : decreaseList) {
int slotIdx = slotAligment.get(item); List<Integer> slots = new ArrayList<>(slotAligment.values());
tile.decrStackSize(slotIdx, item.getStackSize()); tile.decrStackSize(slots.get(0), recipeKey.getStackSize());
} }
} }
@ -113,18 +116,19 @@ public class Recipe {
private boolean match(Consumer<ItemStackKey> actionPerfomer, Collection<ItemStack> inputs) { private boolean match(Consumer<ItemStackKey> actionPerfomer, Collection<ItemStack> inputs) {
if (inputs.size() >= mInputs.length) { if (inputs.size() >= mInputs.length) {
start: start:
for (ItemStack input : inputs) { for (ItemStack[] recipeSlot : mInputs) {
Iterator<ItemStack[]> recipeInputIter = new ArrayList<>(Arrays.asList(mInputs)).iterator(); // Creating instance of normal not connected List<ItemStackKey> variants = Arrays.stream(recipeSlot)
while (recipeInputIter.hasNext()) { // array list to avoid damaging of recipe .map(s -> ItemStackKey.from(s))
.collect(Collectors.toList());
Iterator<ItemStack> machineSlot = new ArrayList<>(inputs).iterator();
while (machineSlot.hasNext()) {
int idx = -1; int idx = -1;
List<ItemStackKey> variants = Arrays.stream(recipeInputIter.next()) ItemStack slot = machineSlot.next();
.map(s -> ItemStackKey.from(s)) if ((idx = variants.indexOf(ItemStackKey.from(slot))) >= 0) {
.collect(Collectors.toList()); if (variants.get(idx).get().stackSize <= slot.stackSize) {
if ((idx = variants.indexOf(ItemStackKey.from(input))) >= 0) {
if (variants.get(idx).get().stackSize <= input.stackSize) {
if (actionPerfomer != null) if (actionPerfomer != null)
actionPerfomer.accept(variants.get(idx)); actionPerfomer.accept(variants.get(idx));
recipeInputIter.remove(); machineSlot.remove();
continue start; continue start;
} }
} }
@ -211,7 +215,7 @@ public class Recipe {
} }
public static boolean addRecipe(List<Recipe> aList, boolean aShapeless, ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt, int aStartEU) { public static boolean addRecipe(List<Recipe> aList, boolean aShapeless, ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt, int aStartEU) {
return addRecipe(aList, aShapeless, new Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt, aStartEU)); return addRecipe(aList, aShapeless, new Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt, aStartEU, true));
} }
public static boolean addRecipe(List<Recipe> aList, boolean aShapeless, Recipe aRecipe) { public static boolean addRecipe(List<Recipe> aList, boolean aShapeless, Recipe aRecipe) {
@ -254,107 +258,121 @@ public class Recipe {
return null; return null;
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt, int aStartEU) { /**
* Default constructor, will create simple recipe
* @param aInput1
* @param aInput2
* @param aOutput1
* @param aOutput2
* @param aOutput3
* @param aOutput4
* @param aDuration
* @param aEUt
* @param aStartEU
* @param unification will forcely add oredict variants to input
*/
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt, int aStartEU, boolean unification) {
/* /*
* Wtf gregorious, what the purpose of this? * Wtf gregorious, what the purpose of this?
*/ */
if (aInput1 != null && aInput1.getItemDamage() != GregTech_API.ITEM_WILDCARD_DAMAGE) { // if (aInput1 != null && aInput1.getItemDamage() != GregTech_API.ITEM_WILDCARD_DAMAGE) {
if (GT_Utility.areStacksEqual(aInput1, aOutput1)) { // if (GT_Utility.areStacksEqual(aInput1, aOutput1)) {
if (aInput1.stackSize >= aOutput1.stackSize) { // if (aInput1.stackSize >= aOutput1.stackSize) {
aInput1.stackSize -= aOutput1.stackSize; // aInput1.stackSize -= aOutput1.stackSize;
aOutput1 = null; // aOutput1 = null;
} else { // } else {
aOutput1.stackSize -= aInput1.stackSize; // aOutput1.stackSize -= aInput1.stackSize;
} // }
} // }
if (GT_Utility.areStacksEqual(aInput1, aOutput2)) { // if (GT_Utility.areStacksEqual(aInput1, aOutput2)) {
if (aInput1.stackSize >= aOutput2.stackSize) { // if (aInput1.stackSize >= aOutput2.stackSize) {
aInput1.stackSize -= aOutput2.stackSize; // aInput1.stackSize -= aOutput2.stackSize;
aOutput2 = null; // aOutput2 = null;
} else { // } else {
aOutput2.stackSize -= aInput1.stackSize; // aOutput2.stackSize -= aInput1.stackSize;
} // }
} // }
if (GT_Utility.areStacksEqual(aInput1, aOutput3)) { // if (GT_Utility.areStacksEqual(aInput1, aOutput3)) {
if (aInput1.stackSize >= aOutput3.stackSize) { // if (aInput1.stackSize >= aOutput3.stackSize) {
aInput1.stackSize -= aOutput3.stackSize; // aInput1.stackSize -= aOutput3.stackSize;
aOutput3 = null; // aOutput3 = null;
} else { // } else {
aOutput3.stackSize -= aInput1.stackSize; // aOutput3.stackSize -= aInput1.stackSize;
} // }
} // }
if (GT_Utility.areStacksEqual(aInput1, aOutput4)) { // if (GT_Utility.areStacksEqual(aInput1, aOutput4)) {
if (aInput1.stackSize >= aOutput4.stackSize) { // if (aInput1.stackSize >= aOutput4.stackSize) {
aInput1.stackSize -= aOutput4.stackSize; // aInput1.stackSize -= aOutput4.stackSize;
aOutput4 = null; // aOutput4 = null;
} else { // } else {
aOutput4.stackSize -= aInput1.stackSize; // aOutput4.stackSize -= aInput1.stackSize;
} // }
} // }
} // }
//
// if (aInput2 != null && aInput2.getItemDamage() != GregTech_API.ITEM_WILDCARD_DAMAGE) {
// if (GT_Utility.areStacksEqual(aInput2, aOutput1)) {
// assert aOutput1 != null;
// if (aInput2.stackSize >= aOutput1.stackSize) {
// aInput2.stackSize -= aOutput1.stackSize;
// aOutput1 = null;
// } else {
// aOutput1.stackSize -= aInput2.stackSize;
// }
// }
// if (GT_Utility.areStacksEqual(aInput2, aOutput2)) {
// assert aOutput2 != null;
// if (aInput2.stackSize >= aOutput2.stackSize) {
// aInput2.stackSize -= aOutput2.stackSize;
// aOutput2 = null;
// } else {
// aOutput2.stackSize -= aInput2.stackSize;
// }
// }
// if (GT_Utility.areStacksEqual(aInput2, aOutput3)) {
// assert aOutput3 != null;
// if (aInput2.stackSize >= aOutput3.stackSize) {
// aInput2.stackSize -= aOutput3.stackSize;
// aOutput3 = null;
// } else {
// aOutput3.stackSize -= aInput2.stackSize;
// }
// }
// if (GT_Utility.areStacksEqual(aInput2, aOutput4)) {
// assert aOutput4 != null;
// if (aInput2.stackSize >= aOutput4.stackSize) {
// aInput2.stackSize -= aOutput4.stackSize;
// aOutput4 = null;
// } else {
// aOutput4.stackSize -= aInput2.stackSize;
// }
// }
// }
if (aInput2 != null && aInput2.getItemDamage() != GregTech_API.ITEM_WILDCARD_DAMAGE) { // Thanks for retardness....spent 40 minutes to find why recycler works so fast
if (GT_Utility.areStacksEqual(aInput2, aOutput1)) { // for (byte i = 64; i > 1; i--) if (aDuration / i > 0) {
assert aOutput1 != null; // if (aInput1 == null || aInput1 .stackSize % i == 0)
if (aInput2.stackSize >= aOutput1.stackSize) { // if (aInput2 == null || aInput2 .stackSize % i == 0)
aInput2.stackSize -= aOutput1.stackSize; // if (aOutput1 == null || aOutput1.stackSize % i == 0)
aOutput1 = null; // if (aOutput2 == null || aOutput2.stackSize % i == 0)
} else { // if (aOutput3 == null || aOutput3.stackSize % i == 0)
aOutput1.stackSize -= aInput2.stackSize; // if (aOutput4 == null || aOutput4.stackSize % i == 0) {
} // if (aInput1 != null) aInput1 .stackSize /= i;
} // if (aInput2 != null) aInput2 .stackSize /= i;
if (GT_Utility.areStacksEqual(aInput2, aOutput2)) { // if (aOutput1 != null) aOutput1.stackSize /= i;
assert aOutput2 != null; // if (aOutput2 != null) aOutput2.stackSize /= i;
if (aInput2.stackSize >= aOutput2.stackSize) { // if (aOutput3 != null) aOutput3.stackSize /= i;
aInput2.stackSize -= aOutput2.stackSize; // if (aOutput4 != null) aOutput4.stackSize /= i;
aOutput2 = null; // aDuration /= i;
} else { // }
aOutput2.stackSize -= aInput2.stackSize; // }
}
}
if (GT_Utility.areStacksEqual(aInput2, aOutput3)) {
assert aOutput3 != null;
if (aInput2.stackSize >= aOutput3.stackSize) {
aInput2.stackSize -= aOutput3.stackSize;
aOutput3 = null;
} else {
aOutput3.stackSize -= aInput2.stackSize;
}
}
if (GT_Utility.areStacksEqual(aInput2, aOutput4)) {
assert aOutput4 != null;
if (aInput2.stackSize >= aOutput4.stackSize) {
aInput2.stackSize -= aOutput4.stackSize;
aOutput4 = null;
} else {
aOutput4.stackSize -= aInput2.stackSize;
}
}
}
for (byte i = 64; i > 1; i--) if (aDuration / i > 0) {
if (aInput1 == null || aInput1 .stackSize % i == 0)
if (aInput2 == null || aInput2 .stackSize % i == 0)
if (aOutput1 == null || aOutput1.stackSize % i == 0)
if (aOutput2 == null || aOutput2.stackSize % i == 0)
if (aOutput3 == null || aOutput3.stackSize % i == 0)
if (aOutput4 == null || aOutput4.stackSize % i == 0) {
if (aInput1 != null) aInput1 .stackSize /= i;
if (aInput2 != null) aInput2 .stackSize /= i;
if (aOutput1 != null) aOutput1.stackSize /= i;
if (aOutput2 != null) aOutput2.stackSize /= i;
if (aOutput3 != null) aOutput3.stackSize /= i;
if (aOutput4 != null) aOutput4.stackSize /= i;
aDuration /= i;
}
}
if (aInput1 == null) { if (aInput1 == null) {
mInputs = new ItemStack [0][]; mInputs = new ItemStack [0][];
} else if (aInput2 == null) { } else if (aInput2 == null) {
mInputs = new ItemStack[][]{ applyOreDict(aInput1) }; // apply oredict optionally, better to make recipe builder mInputs = new ItemStack[][]{ unification ? applyOreDict(aInput1) : new ItemStack[] {aInput1}};
} else { } else {
mInputs = new ItemStack[][] { applyOreDict(aInput1), applyOreDict(aInput2)}; mInputs = new ItemStack[][] { unification ? applyOreDict(aInput1) : new ItemStack[] {aInput1}, unification ? applyOreDict(aInput2) : new ItemStack[] {aInput2}};
} }
mOutputs = new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4}; mOutputs = new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4};
@ -371,7 +389,7 @@ public class Recipe {
// aStartEU = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! // aStartEU = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
public Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aStartEU, int aType) { public Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aStartEU, int aType) {
this(aInput1, null, aOutput1, aOutput2, aOutput3, aOutput4, 0, 0, Math.max(1, aStartEU)); this(aInput1, null, aOutput1, aOutput2, aOutput3, aOutput4, 0, 0, Math.max(1, aStartEU), true);
if (mInputs.length > 0 && aStartEU > 0) { if (mInputs.length > 0 && aStartEU > 0) {
switch (aType) { switch (aType) {
@ -404,126 +422,126 @@ public class Recipe {
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) {
this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aStartEU, 160000000), 0)); this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aStartEU, 160000000), 0), true);
if (mInputs.length > 1 && findEqualRecipe(true, sFusionRecipes, aInput1, aInput2) == null) { if (mInputs.length > 1 && findEqualRecipe(true, sFusionRecipes, aInput1, aInput2) == null) {
addToLists(sFusionRecipes); addToLists(sFusionRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration) {
this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, Math.max(aDuration, 1), 5, 0); this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, Math.max(aDuration, 1), 5, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sCentrifugeRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sCentrifugeRecipes, aInput1, aInput2) == null) {
addToLists(sCentrifugeRecipes); addToLists(sCentrifugeRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) {
this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sElectrolyzerRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sElectrolyzerRecipes, aInput1, aInput2) == null) {
addToLists(sElectrolyzerRecipes); addToLists(sElectrolyzerRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { public Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
this(aInput1, null, aOutput1, aOutput2, null, null, aDuration, aEUt, 0); this(aInput1, null, aOutput1, aOutput2, null, null, aDuration, aEUt, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sLatheRecipes, aInput1) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sLatheRecipes, aInput1) == null) {
addToLists(sLatheRecipes); addToLists(sLatheRecipes);
} }
} }
public Recipe(ItemStack aInput1, int aDuration, ItemStack aOutput1, int aEUt) { public Recipe(ItemStack aInput1, int aDuration, ItemStack aOutput1, int aEUt) {
this(aInput1, null, aOutput1, null, null, null, aDuration, aEUt, 0); this(aInput1, null, aOutput1, null, null, null, aDuration, aEUt, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sCutterRecipes, aInput1) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sCutterRecipes, aInput1) == null) {
addToLists(sCutterRecipes); addToLists(sCutterRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) {
this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, null, 200*aInput1.stackSize, 30, 0); this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, null, 200*aInput1.stackSize, 30, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sSawmillRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sSawmillRecipes, aInput1, aInput2) == null) {
addToLists(sSawmillRecipes); addToLists(sSawmillRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4) {
this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, 100*aInput1.stackSize, 120, 0); this(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, 100*aInput1.stackSize, 120, 0, true);
if (mInputs.length > 0 && aInput2 != null && mOutputs[0] != null && findEqualRecipe(false, sGrinderRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && aInput2 != null && mOutputs[0] != null && findEqualRecipe(false, sGrinderRecipes, aInput1, aInput2) == null) {
addToLists(sGrinderRecipes); addToLists(sGrinderRecipes);
} }
} }
public Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { public Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) {
this(aInput1, aCellAmount>0?GT_Items.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))):null, aOutput1, aOutput2, aOutput3, aOutput4, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, aCellAmount>0?GT_Items.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))):null, aOutput1, aOutput2, aOutput3, aOutput4, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sDistillationRecipes, aInput1, aCellAmount>0?GT_Items.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))):null) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sDistillationRecipes, aInput1, aCellAmount>0?GT_Items.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))):null) == null) {
addToLists(sDistillationRecipes); addToLists(sDistillationRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) {
this(aInput1, aInput2, aOutput1, aOutput2, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), aLevel > 0 ? aLevel : 100); this(aInput1, aInput2, aOutput1, aOutput2, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), aLevel > 0 ? aLevel : 100, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sBlastRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sBlastRecipes, aInput1, aInput2) == null) {
addToLists(sBlastRecipes); addToLists(sBlastRecipes);
} }
} }
public Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { public Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) {
this(aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2>0?aInput2<64?aInput2:64:1, new ItemStack(Blocks.tnt, aInput2>0?aInput2<64?aInput2:64:1)), aOutput1, aOutput2, null, null, 20, 30, 0); this(aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2>0?aInput2<64?aInput2:64:1, new ItemStack(Blocks.tnt, aInput2>0?aInput2<64?aInput2:64:1)), aOutput1, aOutput2, null, null, 20, 30, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sImplosionRecipes, aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2>0?aInput2<64?aInput2:64:1, new ItemStack(Blocks.tnt, aInput2>0?aInput2<64?aInput2:64:1))) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sImplosionRecipes, aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2>0?aInput2<64?aInput2:64:1, new ItemStack(Blocks.tnt, aInput2>0?aInput2<64?aInput2:64:1))) == null) {
addToLists(sImplosionRecipes); addToLists(sImplosionRecipes);
} }
} }
public Recipe(ItemStack aInput1, int aEUt, int aDuration, ItemStack aOutput1) { public Recipe(ItemStack aInput1, int aEUt, int aDuration, ItemStack aOutput1) {
this(aInput1, null, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, null, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sWiremillRecipes, aInput1) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sWiremillRecipes, aInput1) == null) {
addToLists(sWiremillRecipes); addToLists(sWiremillRecipes);
} }
} }
public Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) { public Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) {
this(aInput1, GT_Items.Circuit_Integrated.getWithDamage(0, aInput1.stackSize), aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, GT_Items.Circuit_Integrated.getWithDamage(0, aInput1.stackSize), aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sBenderRecipes, aInput1) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(false, sBenderRecipes, aInput1) == null) {
addToLists(sBenderRecipes); addToLists(sBenderRecipes);
} }
} }
public Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aShape, ItemStack aOutput1) { public Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aShape, ItemStack aOutput1) {
this(aInput1, aShape, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, aShape, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 1 && mOutputs[0] != null && findEqualRecipe(false, sExtruderRecipes, aInput1) == null) { if (mInputs.length > 1 && mOutputs[0] != null && findEqualRecipe(false, sExtruderRecipes, aInput1) == null) {
addToLists(sExtruderRecipes); addToLists(sExtruderRecipes);
} }
} }
public Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1) { public Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1) {
this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sAssemblerRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sAssemblerRecipes, aInput1, aInput2) == null) {
addToLists(sAssemblerRecipes); addToLists(sAssemblerRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) { public Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) {
this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sAlloySmelterRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sAlloySmelterRecipes, aInput1, aInput2) == null) {
addToLists(sAlloySmelterRecipes); addToLists(sAlloySmelterRecipes);
} }
} }
public Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, ItemStack aOutput2) { public Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, ItemStack aOutput2) {
this(aInput1, aInput2, aOutput1, aOutput2, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); this(aInput1, aInput2, aOutput1, aOutput2, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sCannerRecipes, aInput1, aInput2) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sCannerRecipes, aInput1, aInput2) == null) {
addToLists(sCannerRecipes); addToLists(sCannerRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) { public Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) {
this(aInput1, null, aOutput1, null, null, null, Math.max(aDuration, 1), 120, 0); this(aInput1, null, aOutput1, null, null, null, Math.max(aDuration, 1), 120, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sVacuumRecipes, aInput1) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sVacuumRecipes, aInput1) == null) {
addToLists(sVacuumRecipes); addToLists(sVacuumRecipes);
} }
} }
public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration) { public Recipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration) {
this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), 30, 0); this(aInput1, aInput2, aOutput1, null, null, null, Math.max(aDuration, 1), 30, 0, true);
if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sChemicalRecipes, aInput1) == null) { if (mInputs.length > 0 && mOutputs[0] != null && findEqualRecipe(true, sChemicalRecipes, aInput1) == null) {
addToLists(sChemicalRecipes); addToLists(sChemicalRecipes);
} }

View file

@ -168,7 +168,7 @@ public class RecipeLogic {
if (outputs.length <= getMachine().getOutputSlots().length) { if (outputs.length <= getMachine().getOutputSlots().length) {
for (ItemStack out : outputs) { for (ItemStack out : outputs) {
for (int i : getMachine().getOutputSlots()) { for (int i : getMachine().getOutputSlots()) {
if (getMachine().getBaseMetaTileEntity().addStackToSlot(i, out.copy())) { if (out != null && getMachine().getBaseMetaTileEntity().addStackToSlot(i, out.copy())) {
break; break;
} }
} }
@ -203,10 +203,24 @@ public class RecipeLogic {
} }
public int getMaxProgressTime() { public int getMaxProgressTime() {
return maxProgressTime / (int)Math.pow(2, overclockersCount); return maxProgressTime;
} }
public int getProgressTime() { public int getProgressTime() {
return progressTime;
}
/**
* Using ONLY for display time
*/
public int getDisplayMaxProgress() {
return maxProgressTime / (int)Math.pow(2, overclockersCount);
}
/**
* Using ONLY for display time
*/
public int getDisplayProgress() {
return progressTime / (int)Math.pow(2, overclockersCount); return progressTime / (int)Math.pow(2, overclockersCount);
} }

View file

@ -45,7 +45,7 @@ public final class ItemStackKey {
if (isWildcard) { if (isWildcard) {
return this.stack.getItem() == stack.getItem(); return this.stack.getItem() == stack.getItem();
} else { } else {
return ItemStack.areItemStacksEqual(this.stack, stack) && ItemStack.areItemStackTagsEqual(this.stack, stack); return this.stack.isItemEqual(stack);// && ItemStack.areItemStackTagsEqual(this.stack, stack); // TODO add NBT comparing settings
} }
} }
@ -64,6 +64,6 @@ public final class ItemStackKey {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(stack.getItem(), (isWildcard ? GregTech_API.ITEM_WILDCARD_DAMAGE : Items.feather.getDamage(stack)), stack.getTagCompound()); return Objects.hash(stack.getItem(), (isWildcard ? GregTech_API.ITEM_WILDCARD_DAMAGE : Items.feather.getDamage(stack)));//, stack.getTagCompound());
} }
} }

View file

@ -6,6 +6,7 @@ import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.recipe.RecipeLogic;
import gregtechmod.api.util.GT_OreDictUnificator; import gregtechmod.api.util.GT_OreDictUnificator;
import gregtechmod.api.util.GT_Utility; import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -24,6 +25,16 @@ public class GT_MetaTileEntity_AlloySmelter extends GT_MetaTileEntity_BasicMachi
super(recipeMap); super(recipeMap);
} }
@Override
protected void initRecipeLogic(List<Recipe> recipeMap) {
recipeLogic = new RecipeLogic(recipeMap, this) {
@Override
protected void moveItems() {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), getOutputSlots()[0], getOutputSlots()[1], (byte)64, (byte)1, (byte)64, (byte)1);
}
};
}
@Override @Override
public void saveNBTData(NBTTagCompound aNBT) { public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT); super.saveNBTData(aNBT);
@ -68,21 +79,6 @@ public class GT_MetaTileEntity_AlloySmelter extends GT_MetaTileEntity_BasicMachi
return new GT_MetaTileEntity_AlloySmelter(recipeLogic.recipeMap); return new GT_MetaTileEntity_AlloySmelter(recipeLogic.recipeMap);
} }
@Override
public void checkRecipe() {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1);
if (mInventory[1] != null || mInventory[2] != null) {
Recipe tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sAlloySmelterRecipes, mInventory[1], mInventory[2]);
if (tRecipe != null && spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, mInventory[1], mInventory[2])) {
mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration / (1+mHeatingCoilTier);
mOutputItem1 = GT_Utility.copy(tRecipe.getOutput(0));
return;
}
}
mOutputItem1 = null;
}
@Override @Override
public boolean hasTwoSeperateInputs() { public boolean hasTwoSeperateInputs() {
return true; return true;

View file

@ -6,7 +6,7 @@ import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class GT_MetaTileEntity_Assembler extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_Assembler extends GT_MetaTileEntity_BasicMachine {
@ -22,24 +22,15 @@ public class GT_MetaTileEntity_Assembler extends GT_MetaTileEntity_BasicMachine
@Override public void onRightclick(EntityPlayer aPlayer) {getBaseMetaTileEntity().openGUI(aPlayer, 141);} @Override public void onRightclick(EntityPlayer aPlayer) {getBaseMetaTileEntity().openGUI(aPlayer, 141);}
@Override @Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { protected void initRecipeLogic(List<Recipe> recipeMap) {
return new GT_MetaTileEntity_Assembler(recipeLogic.recipeMap); super.initRecipeLogic(recipeMap);
recipeLogic.moveItems = false;
} }
@Override @Override
public void checkRecipe() { public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1); return new GT_MetaTileEntity_Assembler(recipeLogic.recipeMap);
if (mInventory[1] != null || mInventory[2] != null) { }
Recipe tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sAssemblerRecipes, mInventory[1], mInventory[2]);
if (tRecipe != null && spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, mInventory[1], mInventory[2])) {
mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration;
mOutputItem1 = GT_Utility.copy(tRecipe.getOutput(0));
return;
}
}
mOutputItem1 = null;
}
@Override @Override
public boolean hasTwoSeperateInputs() { public boolean hasTwoSeperateInputs() {

View file

@ -2,12 +2,11 @@ package gregtechmod.common.tileentities.machines.basic;
import java.util.List; import java.util.List;
import gregtechmod.api.enums.GT_Items;
import gregtechmod.api.interfaces.IGregTechTileEntity; import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class GT_MetaTileEntity_Bender extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_Bender extends GT_MetaTileEntity_BasicMachine {
@ -27,39 +26,39 @@ public class GT_MetaTileEntity_Bender extends GT_MetaTileEntity_BasicMachine {
return new GT_MetaTileEntity_Bender(recipeLogic.recipeMap); return new GT_MetaTileEntity_Bender(recipeLogic.recipeMap);
} }
@Override // @Override
public void checkRecipe() { // public void checkRecipe() {
GT_Utility.moveStackFromSlotAToSlotB(this.getBaseMetaTileEntity(), this.getBaseMetaTileEntity(), 3, 4, (byte) 64, (byte) 1, (byte) 64, (byte) 1); // GT_Utility.moveStackFromSlotAToSlotB(this.getBaseMetaTileEntity(), this.getBaseMetaTileEntity(), 3, 4, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
if (GT_Utility.isStackValid(mInventory[1])) { // if (GT_Utility.isStackValid(mInventory[1])) {
Recipe tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sBenderRecipes, mInventory[1], mInventory[2]); // Recipe tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sBenderRecipes, mInventory[1], mInventory[2]);
if (tRecipe != null && this.spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, mInventory[1], mInventory[2])) { // if (tRecipe != null && this.spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, mInventory[1], mInventory[2])) {
mEUt = tRecipe.mEUt; // mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration; // mMaxProgresstime = tRecipe.mDuration;
mOutputItem1 = tRecipe.getOutput(0); // mOutputItem1 = tRecipe.getOutput(0);
return; // return;
} // }
//
if (GT_Utility.isStackInvalid(mInventory[2])) { // if (GT_Utility.isStackInvalid(mInventory[2])) {
for (int i = 64; i > 0; --i) { // for (int i = 64; i > 0; --i) {
tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sBenderRecipes, mInventory[1], GT_Items.Circuit_Integrated.getWithDamage(0, (long) i)); // tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sBenderRecipes, mInventory[1], GT_Items.Circuit_Integrated.getWithDamage(0, (long) i));
if (tRecipe != null && this.spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, super.mInventory[1], GT_Items.Circuit_Integrated.getWithDamage(0L, (long) i))) { // if (tRecipe != null && this.spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, super.mInventory[1], GT_Items.Circuit_Integrated.getWithDamage(0L, (long) i))) {
mEUt = tRecipe.mEUt; // mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration; // mMaxProgresstime = tRecipe.mDuration;
mOutputItem1 = tRecipe.getOutput(0); // mOutputItem1 = tRecipe.getOutput(0);
return; // return;
} // }
//
tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sBenderRecipes, GT_Items.Circuit_Integrated.getWithDamage(0L, (long) i), mInventory[1]); // tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sBenderRecipes, GT_Items.Circuit_Integrated.getWithDamage(0L, (long) i), mInventory[1]);
if (tRecipe != null && this.spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, GT_Items.Circuit_Integrated.getWithDamage(0L, (long) i), mInventory[1])) { // if (tRecipe != null && this.spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, GT_Items.Circuit_Integrated.getWithDamage(0L, (long) i), mInventory[1])) {
mEUt = tRecipe.mEUt; // mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration; // mMaxProgresstime = tRecipe.mDuration;
mOutputItem1 = tRecipe.getOutput(0); // mOutputItem1 = tRecipe.getOutput(0);
return; // return;
} // }
} // }
} // }
} // }
} // }
@Override @Override
public int getFrontFacingInactive() { public int getFrontFacingInactive() {

View file

@ -6,9 +6,8 @@ import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Canner extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_Canner extends GT_MetaTileEntity_BasicMachine {
@ -27,22 +26,6 @@ public class GT_MetaTileEntity_Canner extends GT_MetaTileEntity_BasicMachine {
return new GT_MetaTileEntity_Canner(recipeLogic.recipeMap); return new GT_MetaTileEntity_Canner(recipeLogic.recipeMap);
} }
@Override
public void checkRecipe() {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1);
if (mInventory[1] != null || mInventory[2] != null) {
Recipe tRecipe = Recipe.findEqualRecipe(false, false, Recipe.sCannerRecipes, mInventory[1], mInventory[2]);
if (tRecipe != null && spaceForOutput(tRecipe.getOutput(0), tRecipe.getOutput(1)) && tRecipe.isRecipeInputEqual(true, true, mInventory[1], mInventory[2])) {
mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration;
mOutputItem1 = ItemStack.copyItemStack(tRecipe.getOutput(0));
mOutputItem2 = ItemStack.copyItemStack(tRecipe.getOutput(1));
return;
}
}
mOutputItem1 = null;
}
@Override @Override
public boolean hasTwoSeperateInputs() { public boolean hasTwoSeperateInputs() {
return true; return true;

View file

@ -7,8 +7,9 @@ import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_ModHandler; import gregtechmod.api.util.GT_ModHandler;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Compressor extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_Compressor extends GT_MetaTileEntity_BasicMachine {
@ -28,14 +29,17 @@ public class GT_MetaTileEntity_Compressor extends GT_MetaTileEntity_BasicMachine
} }
@Override @Override
public void checkRecipe() { protected void initRecipeLogic(List<Recipe> recipeMap) {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1); super.initRecipeLogic(recipeMap);;
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1); recipeLogic.setRecipeProvider(() -> {
if (mInventory[2] != null && null != (mOutputItem1 = GT_ModHandler.getCompressorOutput(mInventory[2], true, mInventory[3]))) { ItemStack output = null;
mEUt = 2; if (mInventory[2] != null && (output = GT_ModHandler.getCompressorOutput(mInventory[2], false, mInventory[3])) != null) {
mMaxProgresstime = 400; return new Recipe(mInventory[2].copy(), null, output, null, null, null, 400, 2, 0, false); // TODO add methods get input by output, or all recipe here
} }
}
return null;
});
}
@Override @Override
public int getFrontFacingInactive() { public int getFrontFacingInactive() {

View file

@ -7,8 +7,9 @@ import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_ModHandler; import gregtechmod.api.util.GT_ModHandler;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Extractor extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_Extractor extends GT_MetaTileEntity_BasicMachine {
@ -28,13 +29,16 @@ public class GT_MetaTileEntity_Extractor extends GT_MetaTileEntity_BasicMachine
} }
@Override @Override
public void checkRecipe() { protected void initRecipeLogic(List<Recipe> recipeMap) {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1); super.initRecipeLogic(recipeMap);
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1); recipeLogic.setRecipeProvider(() -> {
if (mInventory[2] != null && null != (mOutputItem1 = GT_ModHandler.getExtractorOutput(mInventory[2], true, mInventory[3]))) { ItemStack output = null;
mEUt = 2; if (mInventory[2] != null && null != (output = GT_ModHandler.getExtractorOutput(mInventory[2], true, mInventory[3]))) {
mMaxProgresstime = 400; return new Recipe(mInventory[2].copy(), null, output, null, null, null, 400, 2, 0, true); // TODO add methods get input by output, or all recipe here
} }
return null;
});
} }
@Override @Override

View file

@ -6,6 +6,7 @@ import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.recipe.RecipeLogic;
import gregtechmod.api.util.GT_Utility; import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -27,19 +28,14 @@ public class GT_MetaTileEntity_Lathe extends GT_MetaTileEntity_BasicMachine {
} }
@Override @Override
public void checkRecipe() { protected void initRecipeLogic(List<Recipe> recipeMap) {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1); recipeLogic = new RecipeLogic(recipeMap, this) {
if (mInventory[2] != null && mInventory[2].stackSize > 0) { @Override
Recipe tRecipe = Recipe.findEqualRecipe(false, Recipe.sLatheRecipes, mInventory[2]); public void moveItems() {
if (tRecipe != null && spaceForOutput(tRecipe.getOutput(0), tRecipe.getOutput(1)) && tRecipe.isRecipeInputEqual(true, true, mInventory[2], null)) { GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1);
mEUt = tRecipe.mEUt; }
mMaxProgresstime = tRecipe.mDuration; };
if (tRecipe.getOutput(0) != null) mOutputItem1 = GT_Utility.copy(tRecipe.getOutput(0)); }
if (tRecipe.getOutput(1) != null) mOutputItem2 = GT_Utility.copy(tRecipe.getOutput(1));
return;
}
}
}
@Override @Override
public int getFrontFacingInactive() { public int getFrontFacingInactive() {

View file

@ -7,8 +7,9 @@ import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_ModHandler; import gregtechmod.api.util.GT_ModHandler;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Macerator extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_Macerator extends GT_MetaTileEntity_BasicMachine {
@ -28,13 +29,16 @@ public class GT_MetaTileEntity_Macerator extends GT_MetaTileEntity_BasicMachine
} }
@Override @Override
public void checkRecipe() { protected void initRecipeLogic(List<Recipe> recipeMap) {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1); super.initRecipeLogic(recipeMap);
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1); recipeLogic.setRecipeProvider(() -> {
if (mInventory[2] != null && null != (mOutputItem1 = GT_ModHandler.getMaceratorOutput(mInventory[2], true, mInventory[3]))) { ItemStack output = null;
mEUt = 2; if (mInventory[2] != null && null != (output = GT_ModHandler.getMaceratorOutput(mInventory[2], true, mInventory[3]))) {
mMaxProgresstime = 400; return new Recipe(mInventory[2].copy(), null, output, null, null, null, 400, 2, 0, false); // TODO add methods get input by output, or all recipe here
} }
return null;
});
} }
@Override @Override

View file

@ -6,7 +6,7 @@ import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class GT_MetaTileEntity_PlateCutter extends GT_MetaTileEntity_BasicMachine { public class GT_MetaTileEntity_PlateCutter extends GT_MetaTileEntity_BasicMachine {
@ -26,20 +26,6 @@ public class GT_MetaTileEntity_PlateCutter extends GT_MetaTileEntity_BasicMachin
return new GT_MetaTileEntity_PlateCutter(recipeLogic.recipeMap); return new GT_MetaTileEntity_PlateCutter(recipeLogic.recipeMap);
} }
@Override
public void checkRecipe() {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1);
if (mInventory[2] != null && mInventory[2].stackSize > 0) {
Recipe tRecipe = Recipe.findEqualRecipe(false, Recipe.sCutterRecipes, mInventory[2]);
if (tRecipe != null && spaceForOutput(tRecipe.getOutput(0), null) && tRecipe.isRecipeInputEqual(true, true, mInventory[2], null)) {
mEUt = tRecipe.mEUt;
mMaxProgresstime = tRecipe.mDuration;
if (tRecipe.getOutput(0) != null) mOutputItem1 = GT_Utility.copy(tRecipe.getOutput(0));
return;
}
}
}
@Override @Override
public int getFrontFacingInactive() { public int getFrontFacingInactive() {
return 306; return 306;

View file

@ -29,16 +29,23 @@ public class GT_MetaTileEntity_Recycler extends GT_MetaTileEntity_BasicMachine {
} }
@Override @Override
public void checkRecipe() { public void initRecipeLogic(List<Recipe> recipeMap) {
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 1, 2, (byte)64, (byte)1, (byte)64, (byte)1); super.initRecipeLogic(recipeMap);
GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1); recipeLogic.setRecipeProvider(() -> {
if (mInventory[2] != null && spaceForOutput(GT_ModHandler.getIC2Item("scrap", 1), null)) { if (GT_Utility.isStackValid(mInventory[2])) {
mOutputItem1 = GT_ModHandler.getRecyclerOutput(mInventory[2], getBaseMetaTileEntity().getRandomNumber(8)); ItemStack instance = mInventory[2].copy();
mEUt = 1; instance.stackSize = 1;
mMaxProgresstime = 45; return new Recipe(instance, null, null, null, null, null, 45, 1, 0, false) {
mInventory[2].stackSize--; @Override
} public ItemStack[] getOutputs() {
} return new ItemStack[] {GT_ModHandler.getRecyclerOutput(mInputs[0][0], getBaseMetaTileEntity().getRandomNumber(8))}; // FIXME made chanded output in Recipe
}
};
}
return null;
});
}
@Override @Override
public int getFrontFacingInactive() { public int getFrontFacingInactive() {

View file

@ -8,6 +8,7 @@ import gregtechmod.api.interfaces.IGregTechTileEntity;
import gregtechmod.api.metatileentity.MetaTileEntity; import gregtechmod.api.metatileentity.MetaTileEntity;
import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtechmod.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtechmod.api.recipe.Recipe; import gregtechmod.api.recipe.Recipe;
import gregtechmod.api.recipe.RecipeLogic;
import gregtechmod.api.util.GT_Utility; import gregtechmod.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -35,32 +36,37 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
return new GT_MetaTileEntity_Scanner(recipeLogic.recipeMap); return new GT_MetaTileEntity_Scanner(recipeLogic.recipeMap);
} }
public void checkRecipe() { @Override
GT_Utility.moveStackFromSlotAToSlotB(this.getBaseMetaTileEntity(), this.getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1); public void initRecipeLogic(List<Recipe> recipeMap) {
if(super.mInventory[3] != null) { recipeLogic = new RecipeLogic(recipeMap, this) {
super.bOutputBlocked = true; @Override
} else if(GT_Utility.isStackValid(super.mInventory[1]) && super.mInventory[1].stackSize > 0 && GT_Items.IC2_Crop_Seeds.isStackEqual(super.mInventory[1], true, true)) { protected void moveItems() {
NBTTagCompound tNBT = super.mInventory[1].getTagCompound(); GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), 3, 4, (byte)64, (byte)1, (byte)64, (byte)1);
if(tNBT == null) { }
tNBT = new NBTTagCompound();
}
if(tNBT.getByte("scan") < 4) { @Override
tNBT.setByte("scan", (byte)4); protected Recipe findRecipe() {
super.mMaxProgresstime = 20; if (GT_Utility.isStackValid(mInventory[1]) && GT_Items.IC2_Crop_Seeds.isStackEqual(mInventory[1], true, true)) {
super.mEUt = 500; NBTTagCompound data = mInventory[1].getTagCompound();
} else { if (data == null) return null; // May not work
super.mMaxProgresstime = 1; int dur = 0, eut = 0;
super.mEUt = 1; if (data.getByte("scan") < 4) {
} data.setByte("scan", (byte)4);
dur = 20;
eut = 500;
} else {
dur = 1;
eut = 1;
}
--super.mInventory[1].stackSize; ItemStack output = mInventory[1].copy();
super.mOutputItem1 = GT_Utility.copyAmount(1L, new Object[]{super.mInventory[1]}); output.setTagCompound(data);
super.mOutputItem1.setTagCompound(tNBT); return new Recipe(mInventory[1].copy(), null, output, null, null, null, dur, eut, 0, false);
return; }
}
super.mMaxProgresstime = 0; return null;
}
};
} }
public boolean allowPutStack(int aIndex, byte aSide, ItemStack aStack) { public boolean allowPutStack(int aIndex, byte aSide, ItemStack aStack) {

View file

@ -330,7 +330,7 @@ public class GT_MachineRecipeLoader implements Runnable
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_ModHandler.getIC2Item("carbonFiber", 2L), null, GT_ModHandler.getIC2Item("carbonMesh", 1L), 800, 2); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_ModHandler.getIC2Item("carbonFiber", 2L), null, GT_ModHandler.getIC2Item("carbonMesh", 1L), 800, 2);
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_ModHandler.getIC2Item("carbonMesh", 16L), null, GT_Items.Component_LavaFilter.get(1L), 1600, 8); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_ModHandler.getIC2Item("carbonMesh", 16L), null, GT_Items.Component_LavaFilter.get(1L), 1600, 8);
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_Items.Circuit_Basic.get(1L), GT_ModHandler.getIC2Item("frequencyTransmitter", 1L), GT_Items.NC_SensorKit.get(1L), 1600, 2); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_Items.Circuit_Basic.get(1L), GT_ModHandler.getIC2Item("frequencyTransmitter", 1L), GT_Items.NC_SensorKit.get(1L), 1600, 2);
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_Items.NC_SensorCard.getWildcard(1L), null, GT_Items.Circuit_Basic.get(2L), 1600, 2); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_Items.NC_SensorCard.getWithDamage(1L, 0L), null, GT_Items.Circuit_Basic.get(2L), 1600, 2);
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_ModHandler.getIC2Item("pump", 1L), GregTech_API.getGregTechComponent(6, 1), 800, 16); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_ModHandler.getIC2Item("pump", 1L), GregTech_API.getGregTechComponent(6, 1), 800, 16);
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.heavy_weighted_pressure_plate, 1, 32767), GregTech_API.getGregTechComponent(11, 1), 800, 16); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.heavy_weighted_pressure_plate, 1, 32767), GregTech_API.getGregTechComponent(11, 1), 800, 16);
GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.light_weighted_pressure_plate, 1, 32767), GregTech_API.getGregTechComponent(10, 1), 800, 16); GregTech_API.sRecipeAdder.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.light_weighted_pressure_plate, 1, 32767), GregTech_API.getGregTechComponent(10, 1), 800, 16);