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

Add a getter and setter for Player.heldSlot #930

Closed

Conversation

AkmalFairuz
Copy link
Contributor

@AkmalFairuz AkmalFairuz commented Nov 6, 2024

This pull request introduces new functionality for managing the player's held slot in the hotbar and includes validation to ensure the selected slot is within the valid range. The most important changes include the addition of new methods to the Player struct and updates to the Session struct to handle slot validation.

New functionality for managing held slots:

  • server/player/player.go: Added HeldSlot and SetHeldSlot methods to the Player struct for getting and setting the currently selected hotbar slot.

Validation improvements:

  • server/session/player.go: Updated the SetHeldSlot and UpdateHeldSlot method in the Session struct to include validation for the slot range, ensuring it is between 0 and 8.

@TwistedAsylumMC TwistedAsylumMC added the feature New feature or request label Nov 17, 2024
@TwistedAsylumMC
Copy link
Member

Closing this in favour of #585, still pending further discussion before being merged. We appreciate the pull request though!

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

Successfully merging this pull request may close these issues.

3 participants