Fix BasicMachines accepting wrong items in certain conditions
This commit is contained in:
parent
899973b0dc
commit
a625088776
1 changed files with 11 additions and 15 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue