diff options
author | repo_alt <wvk17@yandex.ru> | 2021-07-18 11:52:19 +0300 |
---|---|---|
committer | repo_alt <wvk17@yandex.ru> | 2021-07-18 11:52:19 +0300 |
commit | 4d8ab247f924f4948724e85275362a66afa78564 (patch) | |
tree | 246ad9699583ad303c00f7fa846f65fac3aa0e92 /src | |
parent | 2337e0fa3748aa29a4d26618eb9d9d43eeed21fa (diff) | |
download | GT5-Unofficial-4d8ab247f924f4948724e85275362a66afa78564.tar.gz GT5-Unofficial-4d8ab247f924f4948724e85275362a66afa78564.tar.bz2 GT5-Unofficial-4d8ab247f924f4948724e85275362a66afa78564.zip |
ME Output bus storeAll returned inverted value
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java index 12d839d221..9b74b979f4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java @@ -65,12 +65,16 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc public boolean storeAll(ItemStack aStack) { if (!GregTech_API.mAE2) return false; - int tTotal = aStack.stackSize; - int tStored = store(aStack); - aStack.stackSize -= tStored; - return tTotal == tStored; + aStack.stackSize = store(aStack); + return aStack.stackSize == 0; } + /** + * Attempt to store items in connected ME network. Returns how many items did not fit (if the network was down e.g.) + * + * @param stack input stack + * @return amount of items left over + */ @Optional.Method(modid = "appliedenergistics2") public int store(final ItemStack stack) { if (stack == null) @@ -80,9 +84,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc if (proxy == null) return stack.stackSize; IMEMonitor<IAEItemStack> sg = proxy.getStorage().getItemInventory(); - final IEnergySource src = proxy.getEnergy(); IAEItemStack toStore = AEApi.instance().storage().createItemStack(stack); - IAEItemStack rest = Platform.poweredInsert( src, sg, toStore, getRequest()); + IAEItemStack rest = Platform.poweredInsert( proxy.getEnergy(), sg, toStore, getRequest()); if (rest != null) return (int)rest.getStackSize(); return 0; |