aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2021-12-18 20:48:51 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2021-12-18 20:48:51 +0000
commit1d307fe3d35a88882f8a3d5a054629f6530d8217 (patch)
tree6a076ad200345866f7add50b4dacb1c7c5084f91 /src/main/java/gtPlusPlus/xmod/gregtech
parent82f2d61465c1fcacfb5104115238c23da0783d0b (diff)
downloadGT5-Unofficial-1d307fe3d35a88882f8a3d5a054629f6530d8217.tar.gz
GT5-Unofficial-1d307fe3d35a88882f8a3d5a054629f6530d8217.tar.bz2
GT5-Unofficial-1d307fe3d35a88882f8a3d5a054629f6530d8217.zip
Change handling of Formaldehyde Catalyst.
Fixed ChemPlant not working correctly.
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
index 42912c4fa8..4a01809ac7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
@@ -55,7 +55,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
+public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<GregtechMTE_ChemicalPlant> {
private int mSolidCasingTier = 0;
private int mMachineCasingTier = 0;
@@ -568,10 +568,18 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
+ public boolean checkRecipe(final ItemStack aStack) {
return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus());
}
+ @Override
+ public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
+ }
@Override
public boolean checkRecipeGeneric(
@@ -586,7 +594,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
this.mMaxProgresstime = 0;
this.mOutputItems = new ItemStack[]{};
this.mOutputFluids = new FluidStack[]{};
-
+
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
long tEnergy = getMaxInputEnergy();
@@ -1035,12 +1043,18 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
@Override
public ArrayList<ItemStack> getStoredInputs() {
ArrayList<ItemStack> tItems = super.getStoredInputs();
+ if (this.hasSlotInGUI() && this.getGUIItemStack() != null) {
+ tItems.add(this.getGUIItemStack());
+ }
for (GT_MetaTileEntity_Hatch_Catalysts tHatch : mCatalystBuses) {
tHatch.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tHatch)) {
- tItems.addAll(tHatch.getContentUsageSlots());
+ if (isValidMetaTileEntity(tHatch)) {
+ AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots();
+ if (!aHatchContent.isEmpty()) {
+ tItems.addAll(aHatchContent);
+ }
}
- }
+ }
return tItems;
}
}