fix wrong bytes display when ingrentent isn't enough and a possible dupe from fluid packet decoder

This commit is contained in:
GlodBlock committed 2022-10-06 23:07:26 +08:00
1 parent b6b9f71677
commit ab4acbe5eb
7 files changed
+56 -33

No files matched your search

@@ -64,12 +64,13 @@ public class TileFluidPacketDecoder extends AENetworkTile implements IGridTickab
inventory.setInventorySlotContents(0, null);
return TickRateModulation.SLEEP;
}
IAEFluidStack aeFluid = AEFluidStack.create(fluid);
IAEFluidStack aeFluid = AEFluidStack.create(fluid.copy());
IEnergyGrid energyGrid = node.getGrid().getCache(IEnergyGrid.class);
IMEMonitor<IAEFluidStack> fluidGrid = node.getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
IAEFluidStack remaining = Platform.poweredInsert(energyGrid, fluidGrid, aeFluid, ownActionSource);
if (remaining != null) {
if (remaining.getStackSize() == aeFluid.getStackSize()) {
inventory.setInventorySlotContents(0, ItemFluidPacket.newStack(remaining.getFluidStack()));
return TickRateModulation.SLOWER;
}
inventory.setInventorySlotContents(0, ItemFluidPacket.newStack(remaining.getFluidStack()));