mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 12:36:40 +00:00
Cleaned up InvalidUsageException and CommandException to be less confusing.
This commit is contained in:
@ -19,10 +19,13 @@
|
||||
|
||||
package com.sk89q.minecraft.util.commands;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class CommandException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 870638193072101739L;
|
||||
@ -48,7 +51,16 @@ public class CommandException extends Exception {
|
||||
commandStack.add(name);
|
||||
}
|
||||
|
||||
public String toStackString(String prefix, String spacedSuffix) {
|
||||
/**
|
||||
* Gets the command that was called, which will include the sub-command
|
||||
* (i.e. "/br sphere").
|
||||
*
|
||||
* @param prefix the command shebang character (such as "/") -- may be empty
|
||||
* @param spacedSuffix a suffix to put at the end (optional) -- may be null
|
||||
* @return the command that was used
|
||||
*/
|
||||
public String getCommandUsed(String prefix, @Nullable String spacedSuffix) {
|
||||
checkNotNull(prefix);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (prefix != null) {
|
||||
builder.append(prefix);
|
||||
|
Reference in New Issue
Block a user