Skip to content

Commit c1e5c7f

Browse files
Copilotrubensworks
andauthored
Fix crash when shift-clicking output slot with empty item stack
Agent-Logs-Url: https://github.com/CyclopsMC/IntegratedTerminals/sessions/ebc0a4b0-8094-4468-a1d8-4e51b8fd7d11 Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
1 parent 50df0bc commit c1e5c7f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/cyclops/integratedterminals/network/packet/TerminalStorageIngredientItemStackCraftingGridShiftClickOutput.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public void actionServer(Level world, ServerPlayer player) {
7474
do {
7575
// Break the loop once we can not add the result into the player inventory anymore
7676
ItemStack insertItem = slotCrafting.getItem();
77+
if (insertItem.isEmpty()) {
78+
break;
79+
}
7780
try (var tx = Transaction.openRoot()) {
7881
if (PlayerInventoryWrapper.of(player).insert(ItemResource.of(insertItem), insertItem.getCount(), tx) != insertItem.getCount()) {
7982
break;

0 commit comments

Comments
 (0)