Skip to content

Commit

Permalink
Fix empty crates and drums not stacking with new ones (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
omergunr100 authored and screret committed Dec 5, 2024
1 parent 07b8881 commit 4b59e69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public void saveToItem(CompoundTag tag) {
}
}

@Override
public boolean saveBreak() {
return isTaped;
}

@Override
public void onMachineRemoved() {
if (!isTaped) clearInventory(inventory.storage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ public InteractionResult onUse(BlockState state, Level world, BlockPos pos, Play
ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}

@Override
public boolean saveBreak() {
return !stored.isEmpty();
}

@Override
protected ItemInteractionResult onScrewdriverClick(Player playerIn, InteractionHand hand, Direction gridSide,
BlockHitResult hitResult) {
Expand Down

0 comments on commit 4b59e69

Please sign in to comment.