Skip to content

Commit

Permalink
Adjust to AE2 api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Demiu committed Jul 26, 2024
1 parent db0e89b commit 197b743
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.util.IterationCounter;

abstract class MEInventoryStackExtractor implements InventoryUtility.ItemStackExtractor {

Expand Down Expand Up @@ -50,7 +51,7 @@ public int takeFromStack(Predicate<ItemStack> predicate, boolean simulate, int c
IEnergySource energy = pair.getLeft();
IMEInventoryHandler<IAEItemStack> cellInventory = pair.getRight();
IItemList<IAEItemStack> items = cellInventory
.getAvailableItems(AEApi.instance().storage().createPrimitiveItemList());
.getAvailableItems(AEApi.instance().storage().createPrimitiveItemList(), IterationCounter.fetchNewId());
// limit the extraction count to maximum supported by power, so we don't have to constantly
// check for power limits later on.
count = Math.min(count, (int) energy.extractAEPower(count, Actionable.SIMULATE, PowerMultiplier.ONE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActi
}

@Override
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out) {
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out, int iteration) {
return rawInventory.getAvailableItems(new IItemList<IAEItemStack>() {

public void addStorage(IAEItemStack option) {
Expand Down Expand Up @@ -235,7 +235,7 @@ public void forEach(Consumer<? super IAEItemStack> action) {
public Spliterator<IAEItemStack> spliterator() {
return out.spliterator();
}
});
}, iteration);
}

@Override
Expand Down

0 comments on commit 197b743

Please sign in to comment.