diff options
author | Alkalus <Draknyte1@hotmail.com> | 2020-06-02 14:33:02 +0100 |
---|---|---|
committer | Alkalus <Draknyte1@hotmail.com> | 2020-06-02 14:33:02 +0100 |
commit | d1a813e829fa4393aeb625ce83c64f079e44cdb0 (patch) | |
tree | c4f54e44597a47f69722a361879ab26c534fd6d6 /src/Java/gtPlusPlus/core/tileentities/general | |
parent | 96a83ee47f994c922aba625b67645661bc8cb4fe (diff) | |
download | GT5-Unofficial-d1a813e829fa4393aeb625ce83c64f079e44cdb0.tar.gz GT5-Unofficial-d1a813e829fa4393aeb625ce83c64f079e44cdb0.tar.bz2 GT5-Unofficial-d1a813e829fa4393aeb625ce83c64f079e44cdb0.zip |
$ Fixed VFC fluid handling.
Diffstat (limited to 'src/Java/gtPlusPlus/core/tileentities/general')
-rw-r--r-- | src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java index e20a538ea7..febe646310 100644 --- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java +++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java @@ -117,25 +117,17 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide return false; } - boolean aAllowFluid = false; - boolean aHasFluid = false; ItemStack[] aInputs = this.getInventory().getInventory().clone(); - for (ItemStack aStack : aInputs) { - if (VolumetricFlaskHelper.getFlaskFluid(aStack) != null) { - aHasFluid = true; - } - } - - if (aHasFluid && !aAllowFluid) { - return false; - } //Check if there is output in slot. Boolean hasOutput = false; if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT] != null) { hasOutput = true; + if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT].stackSize >= 16) { + return false; + } } AutoMap<Integer> aValidSlots = new AutoMap<Integer>(); int aSlotCount = 0; @@ -152,11 +144,13 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide Logger.INFO("Skipping Custom slot as value <= 0"); continue; } + if (e == Container_VolumetricFlaskSetter.SLOT_OUTPUT) { + continue; + } boolean doAdd = false; ItemStack g = this.getStackInSlot(e); - //FluidStack aInputFluidStack = VolumetricFlaskHelper.getFlaskFluid(g); - FluidStack aInputFluidStack = null; + FluidStack aInputFluidStack = VolumetricFlaskHelper.getFlaskFluid(g); int aSize = 0; ItemStack aInputStack = null; int aTypeInSlot = getFlaskType(g); @@ -168,17 +162,18 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide } // Existing Output else { - ItemStack f = this.getStackInSlot(8); - //FluidStack aFluidInCheckedSlot = VolumetricFlaskHelper.getFlaskFluid(f); - FluidStack aFluidInCheckedSlot = null; + ItemStack f = aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT]; + FluidStack aFluidInCheckedSlot = VolumetricFlaskHelper.getFlaskFluid(f); int aTypeInCheckedSlot = getFlaskType(f); // Check that the Circuit in the Output slot is not null and the same type as the circuit input. if (aTypeInCheckedSlot > 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) { if (g.getItem() == f.getItem() && VolumetricFlaskHelper.getFlaskCapacity(f) == getCapacityForSlot(e) && ((aInputFluidStack == null && aFluidInCheckedSlot == null) || aInputFluidStack.isFluidEqual(aFluidInCheckedSlot))) { + Logger.INFO("Input Slot Flask Contains: "+(aInputFluidStack != null ? aInputFluidStack.getLocalizedName() : "Empty")); + Logger.INFO("Output Slot Flask Contains: "+(aFluidInCheckedSlot != null ? aFluidInCheckedSlot.getLocalizedName() : "Empty")); aSize = f.stackSize + g.stackSize; - if (aSize > 64) { + if (aSize > 16) { aInputStack = g.copy(); - aInputStack.stackSize = (aSize-64); + aInputStack.stackSize = (aSize-16); } doAdd = true; } @@ -188,9 +183,9 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide // Check Circuit Type ItemStack aOutput; FluidStack aOutputFluid = null; - /*if (!VolumetricFlaskHelper.isFlaskEmpty(g)) { + if (!VolumetricFlaskHelper.isFlaskEmpty(g)) { aOutputFluid = aInputFluidStack.copy(); - }*/ + } if (aTypeInSlot == 1) { aOutput = VolumetricFlaskHelper.getVolumetricFlask(1); } @@ -211,7 +206,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide if (aOutputFluid.amount > aCapacity) { aOutputFluid.amount = aCapacity; } - //VolumetricFlaskHelper.setFluid(aOutput, aOutputFluid); + VolumetricFlaskHelper.setFluid(aOutput, aOutputFluid); } this.setInventorySlotContents(e, aInputStack); this.setInventorySlotContents(Container_VolumetricFlaskSetter.SLOT_OUTPUT, aOutput); |