Merge pull request #38 from GTNewHorizons/fixes

fix blocking mode and item amount change
This commit is contained in:
Martin Robertz authored and GitHub committed 2022-11-19 17:24:21 +01:00
commit a8d2b12ef9
2 files changed
+14

No files matched your search

@@ -394,6 +394,10 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (mouseButton == 3) {
if (this instanceof GuiBaseFluidPatternTerminal
&& ((GuiBaseFluidPatternTerminal) this).container.isCraftingMode()) {
return;
}
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
if (slot.getHasStack()) {
InventoryAction action = InventoryAction.valueOf("SET_PATTERN_VALUE");
@@ -183,6 +183,10 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
@Override
public boolean containsItems() {
if (invFluids == null && invItems == null) {
// If this entity doesn't have fluid or item inventory, we just view it as full of things.
return true;
}
if (invFluids != null && invFluids.getTankInfo(this.side) != null) {
List<FluidTankInfo[]> tankInfos = new LinkedList<>();
if (invFluids instanceof TileCableBus && ((TileCableBus) invFluids).getPart(this.side) instanceof PartP2PLiquids) {
@@ -212,14 +216,20 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
} else {
tankInfos.add(invFluids.getTankInfo(this.side));
}
boolean hasTank = false;
for (FluidTankInfo[] tankInfoArray : tankInfos) {
for (FluidTankInfo tank : tankInfoArray) {
hasTank = true;
FluidStack fluid = tank.fluid;
if (fluid != null && fluid.amount > 0) {
return true;
}
}
}
if (!hasTank && invItems == null) {
// If this entity doesn't have fluid or item inventory, we just view it as full of things.
return true;
}
}
return invItems != null && invItems.containsItems();
}