Allow numbers in the changer for ExprHotbarSlot #6139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The ExprHotbarSlot currently requires a slot to be able to change the index of the slot.
This means that you have to type
set the currently selected hotbar slot of player to the slot 8 of player
This pull request allows for that still, but also removes the redundancy of typing out the entire slot
set hotbar slot of player to 8
The
Player#setHeldItemSlot
method only takes in an integer, so it makes to sense to support a direct input of an integer.Also fixes a bug where there was no integer check for the input value being under 0 which could lead to an IllegalArgumentException being thrown.
Target Minecraft Versions: any
Requirements: none
Related Issues: none