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 Nov 30, 2024
1 parent c8c28ba commit c96bfb7
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 @@ -139,6 +139,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 @@ -207,6 +207,11 @@ public InteractionResult onUse(BlockState state, Level world, BlockPos pos, Play
return world.isClientSide ? InteractionResult.SUCCESS : InteractionResult.PASS;
}

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

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

0 comments on commit c96bfb7

Please sign in to comment.