MCPcopy Create free account
hub / github.com/Teneted/Tenet / getCommand

Method getCommand

src/main/java/org/bukkit/plugin/java/JavaPlugin.java:307–321  ·  view source on GitHub ↗

Gets the command with the given name, specific to this plugin. Commands need to be registered in the PluginDescriptionFile#getCommands() PluginDescriptionFile to exist at runtime. @param name name or alias of the command @return the plugin command if found, otherwise null

(@NotNull String name)

Source from the content-addressed store, hash-verified

305 * @return the plugin command if found, otherwise null
306 */
307 @Nullable
308 public PluginCommand getCommand(@NotNull String name) {
309 String alias = name.toLowerCase(java.util.Locale.ENGLISH);
310 PluginCommand command = getServer().getPluginCommand(alias);
311
312 if (command == null || command.getPlugin() != this) {
313 command = getServer().getPluginCommand(description.getName().toLowerCase(java.util.Locale.ENGLISH) + ":" + alias);
314 }
315
316 if (command != null && command.getPlugin() == this) {
317 return command;
318 } else {
319 return null;
320 }
321 }
322
323 @Override
324 public void onLoad() {}

Callers

nothing calls this directly

Calls 5

getServerMethod · 0.95
getPluginMethod · 0.95
toLowerCaseMethod · 0.80
getPluginCommandMethod · 0.65
getNameMethod · 0.65

Tested by

no test coverage detected