Skip to content

Refactor permission checks in punishment commands for improved accuracy - #21

Merged
Adammatthiesen merged 1 commit into
mainfrom
more-fixes
Oct 20, 2026
Merged

Adammatthiesen merged 1 commit into
mainfrom
more-fixes

Conversation

@Adammatthiesen

Copy link
Copy Markdown
Member

This pull request updates the punishment command logic to improve permission handling and error messaging. The main changes clarify permission checks when punishing players and enhance user feedback.

Permission and error handling improvements:

  • In PunishCommands.java, when a player does not have permission to punish another player, a clear error message is now sent to the command issuer, indicating the lack of permission and specifying the target player (You do not have permission to punish this player: ...).
  • The error message for a missing player entry now consistently uses the imported ChatFormatting.RED for styling, improving code clarity. [1] [2]

Permission checking logic:

  • In Helpers.java, the check for the BLOCK_PUNISHMENTS_PERMISSION permission now correctly evaluates the target profile's online player rather than the command source, ensuring that protected players cannot be punished even if the issuer has high permissions.

@Adammatthiesen
Adammatthiesen marked this pull request as ready for review October 20, 2026 06:21
@Adammatthiesen
Adammatthiesen merged commit eebd4d8 into main Oct 20, 2026
1 check passed
@Adammatthiesen
Adammatthiesen deleted the more-fixes branch October 20, 2026 06:25
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.

1 participant