Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #94 from minecraft7771/AssemblyLineDataConnectorFix
Browse files Browse the repository at this point in the history
Fix Assembly Line Slave Connector dropping all Data Sticks
  • Loading branch information
Dream-Master authored Sep 4, 2022
2 parents 0a5b94f + 9eb28fd commit 335b5b7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ public int getSizeInventory() {

@Override
public ItemStack getStackInSlot(int aIndex) {
return stacks != null && aIndex < stacks.length ? stacks[aIndex] : null;
if (stacks == null || aIndex >= stacks.length) {
return null;
}
// We return a stack with size 0 to prevent dropping when the hatch is broken
ItemStack stackCopy = stacks[aIndex].copy();
stackCopy.stackSize = 0;
return stackCopy;
}

@Override
Expand Down

0 comments on commit 335b5b7

Please sign in to comment.