Skip to content

Command God Rework#184

Merged
Maxlego08 merged 5 commits into
Maxlego08:developfrom
Kylewhite192:develop
Jul 21, 2025
Merged

Command God Rework#184
Maxlego08 merged 5 commits into
Maxlego08:developfrom
Kylewhite192:develop

Conversation

@Kylewhite192

@Kylewhite192 Kylewhite192 commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

Had no idea how to edit previous PR so decided to create new one.
Changes:

  • Refactored AttributeUtils function to avoid .getOrThrow, improving compatibility across versions.
  • Made various improvements to the God command:
    • Added support for "god other" permission node.
    • Implemented tab completion.
    • Streamlined and cleaned up the code for better maintainability and adaptability.
    • Fixed syntax error that occurred when enabling God mode.
    • With new changes supported versions should be 1.20.6 & 1.21

.getOrThrow causing problems in different versions, causing null
Quite a few various changes,
- Added God Other permission node.
-  Tab completion
- Streamlined code down should function correctly and allow adaptability.
- Fixed syntax error when enabling God Mode.
@alwyn974 alwyn974 requested a review from Copilot July 19, 2025 11:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the God command implementation to improve compatibility and functionality. The changes focus on replacing deprecated API usage and adding enhanced permission controls for managing god mode on other players.

Key changes:

  • Replaced .getOrThrow() with .get() in AttributeUtils to improve version compatibility
  • Enhanced God command with permission-based access control for targeting other players
  • Added comprehensive error handling and improved user messaging

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
AttributeUtils.java Refactored attribute retrieval to use .get() instead of .getOrThrow() for better compatibility
CommandGod.java Added "god other" permission, tab completion, improved error handling, and enhanced messaging
Permission.java Added new ESSENTIALS_GOD_OTHER permission enum value

Two constants added at class level
One line changed to use the constant instead of magic number
One line added to set food level using the constant
✅ Reverts god mode state - user.setOption(Option.GOD, wasGodEnabled)
✅ Updates local variable - isGodEnabled = wasGodEnabled
✅ Maintains consistency - Player's god mode option matches their actual state
✅ Correct messaging - User gets the right message about the final state
@Maxlego08 Maxlego08 merged commit d36d70a into Maxlego08:develop Jul 21, 2025
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.

3 participants