Minor code changes

This commit is contained in:
MattBDev
2020-01-29 17:53:34 -05:00
parent 7236b0a026
commit 336e411e10
14 changed files with 28 additions and 31 deletions

View File

@ -28,7 +28,7 @@ import java.util.Map;
import java.util.Set;
public class CommandContext {
protected final String command;
protected final List<String> parsedArgs;
@ -55,7 +55,7 @@ public class CommandContext {
this(args.split(" ", -1), valueFlags);
}
public CommandContext(String args, Set<Character> valueFlags, boolean allowHangingFlag)
public CommandContext(String args, Set<Character> valueFlags, boolean allowHangingFlag)
throws CommandException {
this(args.split(" ", -1), valueFlags, allowHangingFlag, new CommandLocals());
}
@ -107,7 +107,7 @@ public class CommandContext {
List<String> argList = new ArrayList<>(args.length);
for (int i = 1; i < args.length; ++i) {
isHanging = false;
String arg = args[i];
if (arg.isEmpty()) {
isHanging = true;
@ -216,7 +216,7 @@ public class CommandContext {
parsedArgs.add(arg);
}
}
this.suggestionContext = suggestionContext;
}
@ -248,7 +248,7 @@ public class CommandContext {
}
return buffer.toString();
}
public String getRemainingString(int start) {
return getString(start, parsedArgs.size() - 1);
}

View File

@ -53,7 +53,7 @@ public class CommandException extends Exception {
/**
* Gets the command that was called, which will include the sub-command
* (i.e., "/br sphere").
* (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

View File

@ -47,8 +47,4 @@ public class CommandLocals {
return locals.put(key, value);
}
public Object putIfAbsent(Object key, Object value) {
return locals.putIfAbsent(key, value);
}
}

View File

@ -20,6 +20,9 @@
package com.sk89q.minecraft.util.commands;
import com.sk89q.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@ -30,9 +33,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.enginehub.piston.inject.InjectedValueAccess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Manager for handling commands. This allows you to easily process commands,

View File

@ -50,4 +50,4 @@ public class SimpleInjector implements Injector {
return null;
}
}
}
}

View File

@ -22,4 +22,4 @@
* to Piston, Intake, ACF, or similar systems.
*/
@Deprecated
package com.sk89q.minecraft.util.commands;
package com.sk89q.minecraft.util.commands;