mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
Override toString() method in Command
Overriding the toString() method provides more human-readable feedback when a problem occurs, including the version of the plugin if applicable. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
parent
b8e592c987
commit
c2bebbcdbb
@ -350,4 +350,9 @@ public abstract class Command {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + '(' + name + ')';
|
||||
}
|
||||
}
|
||||
|
@ -144,4 +144,12 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
||||
}
|
||||
return completions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder stringBuilder = new StringBuilder(super.toString());
|
||||
stringBuilder.deleteCharAt(stringBuilder.length() - 1);
|
||||
stringBuilder.append(", ").append(owningPlugin.getDescription().getFullName()).append(')');
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user