add checks to 0 sized stacks

This commit is contained in:
PrototypeTrousers
2023-07-12 15:00:59 -03:00
parent 3c62ac79c3
commit f4303fc1ec
3 changed files with 15 additions and 10 deletions
@@ -200,6 +200,9 @@ public class PacketJEIRecipe extends AppEngPacket {
if (request.getItem().isDamageable() || Platform.isGTDamageableItem(request.getItem())) {
Collection<IAEItemStack> outList = inv.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)).getStorageList().findFuzzy(request, FuzzyMode.IGNORE_ALL);
for (IAEItemStack is : outList) {
if (is.getStackSize() == 0) {
continue;
}
if (Platform.isGTDamageableItem(request.getItem())) {
if (!(is.getDefinition().getMetadata() == request.getDefinition().getMetadata())) {
continue;
@@ -132,23 +132,25 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
continue;
}
if( this.craftOnly() )
{
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
continue;
}
if (this.craftOnly()) {
this.didSomething = this.craftingTracker.handleCrafting(slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc) || this.didSomething;
continue;
}
final long before = this.itemToSend;
if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0) {
for (final IAEItemStack o : ImmutableList.copyOf(inv.getStorageList().findFuzzy(ais, fzMode))) {
this.pushItemIntoTarget(destination, energy, inv, o);
if (this.itemToSend <= 0) {
break;
if (o.getStackSize() > 0) {
this.pushItemIntoTarget(destination, energy, inv, o);
if (this.itemToSend <= 0) {
break;
}
}
}
} else {
if (inv.getStorageList().findPrecise(ais) != null) {
final IAEItemStack o = inv.getStorageList().findPrecise(ais);
if (o != null && o.getStackSize() > 0) {
this.pushItemIntoTarget(destination, energy, inv, ais);
}
}
@@ -113,7 +113,7 @@ public class IMEAdaptor extends InventoryAdaptor {
IAEItemStack out = null;
for (final IAEItemStack req : ImmutableList.copyOf(this.getList().findFuzzy(reqFilter, fuzzyMode))) {
if (req != null) {
if (req != null && req.getStackSize() > 0) {
req.setStackSize(amount);
out = this.target.extractItems(req, type, this.src);
if (out != null) {