From 996593375eccbc78685fd8005ebd96ae45b130cb Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 30 Jan 2022 15:02:44 +0100 Subject: [PATCH] Backport 1224833c7728c338e47e0acd1c6079e013e90dc2 to MC 1.16.5 (0.5.2) --- CHANGELOG.md | 1 + .../pipe/attachment/extractor/ExtractorAttachment.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1a159a..bc673e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed random client crashes by [@malte0811](https://github.com/malte0811). +- Fixed crash when Extractor Attachment is interacting with inventories that have no slots. ## [0.5.1] - 2021-11-28 diff --git a/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java b/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java index 3e36646..47c0d60 100644 --- a/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java +++ b/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java @@ -139,6 +139,10 @@ private void update(ItemNetwork network, BlockPos sourcePos, IItemHandler source } private Pair findDestinationAndSourceSlot(BlockPos sourcePos, IItemHandler source) { + if (source.getSlots() <= 0) { + return null; + } + int startIndex = 0; do {