Skip to content

Add explicit check if we are swapping from and to the same slot - #160

Merged
Caedis merged 1 commit into
GTNewHorizons:masterfrom
mcmlevi:fix_item_deletion
Aug 24, 2026
Merged

Add explicit check if we are swapping from and to the same slot#160
Caedis merged 1 commit into
GTNewHorizons:masterfrom
mcmlevi:fix_item_deletion

Conversation

@mcmlevi

@mcmlevi mcmlevi commented Aug 23, 2026

Copy link
Copy Markdown

Closes GTNewHorizons/GT-New-Horizons-Modpack#26398

Summary

We had unexpected behavior when swapping to the same hot bar slot leading to items being deleted. This PR adds an explicit check stopping you from being able to swap if the to and from slots are the same. As this shouldn't ever swap anyhow as they are the same slot.

This also seems to lead to the items not being deleted from your inventory.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

We had unexpected behavior when swapping to the same hot bar slot. As this shouldn't ever swap anyhow as they are the same slot. An explicit check has been added for it. This also seems to lead to the items not being deleted from your inventory.

@Angry3vilbot Angry3vilbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, doubt it would break anything either, and the issue is fixed. IANA org member though.

@Dream-Master

Copy link
Copy Markdown
Member

Code LGTM, doubt it would break anything either, and the issue is fixed. IANA org member though.

You not org member. The approve not count. This pr is draft and can't be merged any way. If you want to become org member just send me a pm .

@mcmlevi

mcmlevi commented Aug 24, 2026

Copy link
Copy Markdown
Author

@Dream-Master I should propably publish it by now, in this case I did specifically ask other people to take a look at it as I was worried about potential fall-out. Mainly as I have strong suspiciouns this is the core of the issue, however I had yet to be able to see the part where the bugs happen. So wanteted some additional looks / eyes on the problem. But I will publish for now as it's technically ready.

@mcmlevi
mcmlevi marked this pull request as ready for review August 24, 2026 06:42
@Caedis
Caedis merged commit a1cdcd1 into GTNewHorizons:master Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pressing hotbar slot key when hovering the slot in fluid tank ui voids items

5 participants