aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorBlood-Asp <bloodasphendrik@gmail.com>2015-12-05 00:33:52 +0100
committerBlood-Asp <bloodasphendrik@gmail.com>2015-12-05 00:33:52 +0100
commita625088776675f9baec9149728f2b622281391e6 (patch)
tree2679bc3f25c4042c2d1445189f347b11b75b211b /src/main/java/gregtech/api/metatileentity
parent899973b0dc29dd36aae39f1b69fa8aa3f95a561a (diff)
downloadGT5-Unofficial-a625088776675f9baec9149728f2b622281391e6.tar.gz
GT5-Unofficial-a625088776675f9baec9149728f2b622281391e6.tar.bz2
GT5-Unofficial-a625088776675f9baec9149728f2b622281391e6.zip
Fix BasicMachines accepting wrong items in certain conditions
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
index e40d505e68..edab9b77c5 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
@@ -550,21 +550,17 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB);
}
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
- if (mInventory[aIndex] != null) return true;
- switch (mInputSlotCount) {
- case 0:
- return false;
- case 1:
- return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), new ItemStack[]{aStack});
- case 2:
- return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0) != null && getInputAt(1) != null) || (getInputAt(0) == null && getInputAt(1) == null ? getRecipeList().containsInput(aStack) : null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[]{aStack, getInputAt(1)} : new ItemStack[]{getInputAt(0), aStack}))));
- default:
- return getRecipeList().containsInput(aStack);
- }
- }
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
+ if (mInventory[aIndex] != null) return true;
+ switch (mInputSlotCount) {
+ case 0: return false;
+ case 1: return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), new ItemStack[] {aStack});
+ case 2: return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0)!=null&&getInputAt(1)!=null) || (getInputAt(0)==null&&getInputAt(1)==null?getRecipeList().containsInput(aStack):(getRecipeList().containsInput(aStack)&&null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[] {aStack, getInputAt(1)} : new ItemStack[] {getInputAt(0), aStack})))));
+ default: return getRecipeList().containsInput(aStack);
+ }
+ }
@Override
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {