Commits

Parker Hawke authored and md_5 committed 0a850d95d96
#993: Deprecate Command's permission message methods as they no longer work

Ever since Mojang's introduction of Brigadier in 1.13, the client is not sent any commands to which it does not have permission to execute. If a client executes a command it is not aware of (and consequently does not have permission for), the client will send itself instead of forwarding the failure to the server for its response.
No tags

src/main/java/org/bukkit/command/Command.java

Modified
307 307 @NotNull
308 308 public List<String> getAliases() {
309 309 return activeAliases;
310 310 }
311 311
312 312 /**
313 313 * Returns a message to be displayed on a failed permission check for this
314 314 * command
315 315 *
316 316 * @return Permission check failed message
317 + * @deprecated permission messages have not worked for player-executed
318 + * commands since 1.13 as clients without permission to execute a command
319 + * are unaware of its existence and therefore will not send an unknown
320 + * command execution to the server. This message will only ever be shown to
321 + * consoles or when this command is executed with
322 + * {@link Bukkit#dispatchCommand(CommandSender, String)}.
317 323 */
324 + @Deprecated
318 325 @Nullable
319 326 public String getPermissionMessage() {
320 327 return permissionMessage;
321 328 }
322 329
323 330 /**
324 331 * Gets a brief description of this command
325 332 *
326 333 * @return Description of this command
327 334 */
371 378 this.description = (description == null) ? "" : description;
372 379 return this;
373 380 }
374 381
375 382 /**
376 383 * Sets the message sent when a permission check fails
377 384 *
378 385 * @param permissionMessage new permission message, null to indicate
379 386 * default message, or an empty string to indicate no message
380 387 * @return this command object, for chaining
388 + * @deprecated permission messages have not worked for player-executed
389 + * commands since 1.13 as clients without permission to execute a command
390 + * are unaware of its existence and therefore will not send an unknown
391 + * command execution to the server. This message will only ever be shown to
392 + * consoles or when this command is executed with
393 + * {@link Bukkit#dispatchCommand(CommandSender, String)}.
381 394 */
395 + @Deprecated
382 396 @NotNull
383 397 public Command setPermissionMessage(@Nullable String permissionMessage) {
384 398 this.permissionMessage = permissionMessage;
385 399 return this;
386 400 }
387 401
388 402 /**
389 403 * Sets the example usage of this command
390 404 *
391 405 * @param usage new example usage

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut