Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Item Exchanging #346

Closed
hammy275 opened this issue Jan 27, 2024 · 7 comments
Closed

Better Item Exchanging #346

hammy275 opened this issue Jan 27, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@hammy275
Copy link
Owner

hammy275 commented Jan 27, 2024

Need to do a giant QoL pass over item swapping.

@hammy275 hammy275 added the enhancement New feature or request label Jan 27, 2024
@hammy275 hammy275 added this to the Version 1.5.0 Alpha 2 milestone Jan 27, 2024
@hammy275
Copy link
Owner Author

hammy275 commented May 19, 2024

Main things are:

  • We should allow grabbing items even if the hand item is full (if there's inventory space).
  • Stack with items already in the inventory more often.

@hammy275
Copy link
Owner Author

hammy275 commented Sep 9, 2024

Related: #451. This issue covers merging under the system currently in place, including non-VR players, while #451 covers the system to-be-added, which is only for VR players as of writing.

@hammy275
Copy link
Owner Author

There's two code paths that handle swaps:

  • ItemStorage#placeItem for world storage Immersives.
  • ImmersiveLogicHelpers#swapItems for not world storage Immersives.

These two code paths really need to be combined. However, because of how intertwined the return count logic is in the first, this is easier said than done.

I think the best approach would be to move placeItem to somewhere in ServerUtil, and make the provided ItemStorage @Nullable. From here, both methods above can call it, with the latter providing null since there are no return item counts to increment. All of the item count changing should be made into helper functions in ItemStorage to make the function far less messy.

@hammy275
Copy link
Owner Author

hammy275 commented Oct 10, 2024

Downporting time:

  • 1.21.1
  • 1.20.4
  • 1.20.2
  • 1.20.1
  • 1.19.4
  • 1.19.3
  • 1.19.2
  • 1.18.2

@hammy275
Copy link
Owner Author

Reopening, since I'm 99% sure the item return counts get messed up when switching between two different, not empty items

@hammy275 hammy275 reopened this Oct 10, 2024
@hammy275
Copy link
Owner Author

@hammy275
Copy link
Owner Author

There we go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant