From 5cda7beca7b27e589044fec053f826aa9d5c97d4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 17 Oct 2020 04:15:53 +0200 Subject: [PATCH] fixed inventories with max stack sizes over 64 not being seen by terminals correctly --- .../de/ellpeck/prettypipes/network/NetworkLocation.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/prettypipes/network/NetworkLocation.java b/src/main/java/de/ellpeck/prettypipes/network/NetworkLocation.java index 0e7e36c..849c2bd 100644 --- a/src/main/java/de/ellpeck/prettypipes/network/NetworkLocation.java +++ b/src/main/java/de/ellpeck/prettypipes/network/NetworkLocation.java @@ -55,12 +55,13 @@ public class NetworkLocation implements INBTSerializable { IItemHandler handler = this.getItemHandler(world); if (handler != null) { for (int i = 0; i < handler.getSlots(); i++) { - ItemStack found = handler.extractItem(i, Integer.MAX_VALUE, true); - if (found.isEmpty()) + // check if the slot is accessible to us + if (handler.extractItem(i, 1, true).isEmpty()) continue; if (this.itemCache == null) this.itemCache = new HashMap<>(); - this.itemCache.put(i, found); + // use getStackInSlot since there might be more than 64 items in there + this.itemCache.put(i, handler.getStackInSlot(i)); } } }