You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the command permission system has no way of controlling Brigadier commands which is quite a big problem as more mods are beginning to use them.
This makes those commands work with the permission system just like regular minecraft commands.
Has been tested with each of the gtnhlib team commands along with its various sub-commands and all seem to work as expected.
Why do we control commands like this rather than mixing into ICommandSender#canCommandSenderUseCommand(int permissionLevel, String command)?
int permissionLevel means that the same command can provide multiple levels of commands by checking with different numbers. (For example, /gtnhteam rename would check 0, "gtnhteam", while /gtnhteam_admin rename would check 2, "gtnhteam_admin")
String command means that we could even provide extra features by putting in longer strings into the second parameter. All vanilla commands (including CommandBase, which most mods use for their custom commands) pass just the command name for the second parameter, but we could make subcommands pass longer strings (such as checking 0, "gtnhteam rename" for /gtnhteam rename.) It would be entirely back-compatible with all existing commands since vanilla would never pass a space inside the second parameter.
Or is the issue that some modded commands don't check canCommandSenderUseCommand at all?
Commands won't necessarily use canCommandSenderUseCommand.
They can define who has access in their own weird ways, and some modded commands do exactly that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Currently the command permission system has no way of controlling Brigadier commands which is quite a big problem as more mods are beginning to use them.
This makes those commands work with the permission system just like regular minecraft commands.
Has been tested with each of the gtnhlib team commands along with its various sub-commands and all seem to work as expected.