03.04.2016, 17:31
@Su37Erich: The UsageMessageSupplier changed in 1.3, it now looks like this:
and the default one looks like this:
PHP код:
@FunctionalInterface
public interface UsageMessageSupplier {
String get(Player player, String prefix, CommandEntry command);
}
PHP код:
public static final UsageMessageSupplier DEFAULT_USAGE_MESSAGE_SUPPLIER = (player, prefix, command) ->
{
StringBuilder stringBuilder = new StringBuilder("Usage: " + prefix + command.getCommand());
if(command.getParameters().length > 0) {
for(int i = 0; i < command.getParameters().length; i++) {
stringBuilder.append(" [").append(command.getParameters()[i].name()).append("]");
}
}
if(command.getHelpMessage() != null)
stringBuilder.append(" - ").append(command.getHelpMessage());
return stringBuilder.toString();
};