Skip to content

Commit

Permalink
Inline CommandAPIBukkit#getKnownCommands since it is only being use…
Browse files Browse the repository at this point in the history
…d once
  • Loading branch information
willkroboth committed Aug 6, 2023
1 parent db979a3 commit cc7f8a6
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public void unregister(String commandName, boolean force) {
if (!CommandAPI.canRegister() || force) {
// Bukkit is done with normal command stuff, so we have to modify their CommandMap ourselves
// If we're forcing, we'll also go here to make sure commands are really gone
Map<String, Command> knownCommands = getKnownCommands();
Map<String, Command> knownCommands = commandMapKnownCommands.get((SimpleCommandMap) paper.getCommandMap());
knownCommands.remove(commandName);
if (force) removeCommandNamespace(knownCommands, commandName);

Expand Down Expand Up @@ -531,10 +531,6 @@ private void removeCommandNamespace(Map<String, ?> map, String commandName) {
}
}

private Map<String, Command> getKnownCommands() {
return commandMapKnownCommands.get((SimpleCommandMap) paper.getCommandMap());
}

@Override
@Unimplemented(because = REQUIRES_MINECRAFT_SERVER)
public abstract CommandDispatcher<Source> getBrigadierDispatcher();
Expand Down

0 comments on commit cc7f8a6

Please sign in to comment.