diff options
author | Maxim <maxim235@gmx.de> | 2022-08-12 12:58:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 11:58:12 +0100 |
commit | 7e93aca8588aea28188d97aaa79a6c7d5365a4f5 (patch) | |
tree | bbfad0ec7136263658bf345050fbea89837447f0 /src/main/java/gtPlusPlus | |
parent | c2e1697d9a7d4697f8a96bf838cd0c038fce2f01 (diff) | |
download | GT5-Unofficial-7e93aca8588aea28188d97aaa79a6c7d5365a4f5.tar.gz GT5-Unofficial-7e93aca8588aea28188d97aaa79a6c7d5365a4f5.tar.bz2 GT5-Unofficial-7e93aca8588aea28188d97aaa79a6c7d5365a4f5.zip |
Respect the fluid that is locked in the hatch when searching for free hatches (#275)
Diffstat (limited to 'src/main/java/gtPlusPlus')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index e011723ab3..d50079803f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -617,6 +617,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1(); // Fluid in the Hatch FluidStack aHatchStack = aOutputHatches.get(i).getValue_2(); + // Fluid that the hatch is locked to + String aHatchLockedFluid = aOutputHatches.get(i).getValue_1().getLockedFluidName(); // Space left in Hatch int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount(); // Hatch is full, @@ -625,14 +627,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En aOutputHatches.remove(aOutputHatches.get(i)); i--; continue; - } + } // Hatch has space else { // Check if any fluids match //aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) { for(int j = 0;j<aOutputFluids.size();j++) { //log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack "+aOutputStack.getLocalizedName()); - if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))) { + if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j)) && (aHatchLockedFluid == null || aHatchLockedFluid.equals(aOutputFluids.get(j).getFluid().getName()))) { int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes; // Not Enough space to insert all of the fluid. // We fill this hatch and add a smaller Fluidstack back to the iterator. @@ -698,6 +700,9 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } } + else if (aHatchLockedFluid == null || aHatchLockedFluid.equals(aOutputFluids.get(j).getFluid().getName())) { + aEmptyFluidHatches++; + } else { continue; } @@ -707,7 +712,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) { // Free Hatch - if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) { + if ((aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) && !aFreeHatchCheck.getValue_1().isFluidLocked()) { aEmptyFluidHatches++; } } |