Update some stuff
Dieser Commit ist enthalten in:
Ursprung
0bd3f2bd88
Commit
2a2dbd9458
@ -170,7 +170,7 @@ public abstract class AbstractSWCommand<T> {
|
||||
if (compare != 0) {
|
||||
return compare;
|
||||
} else {
|
||||
return Double.compare(o1.comparableValue, o2.comparableValue);
|
||||
return Integer.compare(o1.comparableValue, o2.comparableValue);
|
||||
}
|
||||
});
|
||||
commandHelpList.sort((o1, o2) -> {
|
||||
|
@ -23,7 +23,6 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Parameter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@ -31,14 +30,6 @@ import java.util.function.Predicate;
|
||||
|
||||
public class SubCommand<T> {
|
||||
|
||||
private static Map<Class<?>, Double> increment = new HashMap<>();
|
||||
static {
|
||||
increment.put(double.class, 0.1);
|
||||
increment.put(Double.class, 0.1);
|
||||
increment.put(float.class, 0.1);
|
||||
increment.put(Float.class, 0.1);
|
||||
}
|
||||
|
||||
private AbstractSWCommand<T> abstractSWCommand;
|
||||
Method method;
|
||||
String[] description;
|
||||
@ -47,7 +38,7 @@ public class SubCommand<T> {
|
||||
private Function<T, ?> senderFunction;
|
||||
AbstractGuardChecker<T> guardChecker;
|
||||
boolean noTabComplete;
|
||||
double comparableValue;
|
||||
int comparableValue;
|
||||
|
||||
private CommandPart<T> commandPart;
|
||||
|
||||
@ -60,9 +51,6 @@ public class SubCommand<T> {
|
||||
|
||||
Parameter[] parameters = method.getParameters();
|
||||
comparableValue = parameters[parameters.length - 1].isVarArgs() ? Integer.MAX_VALUE : -parameters.length;
|
||||
for (Parameter parameter : parameters) {
|
||||
comparableValue += increment.getOrDefault(parameter.getType(), 0.0);
|
||||
}
|
||||
|
||||
guardChecker = SWCommandUtils.getGuardChecker(parameters[0], localGuardChecker);
|
||||
|
||||
|
@ -3,3 +3,5 @@ build:
|
||||
- "cp ~/gradle.properties ."
|
||||
- "chmod u+x build.gradle"
|
||||
- "./gradlew buildProject"
|
||||
|
||||
artifacts:
|
||||
|
@ -39,7 +39,7 @@ public class ArgumentCommand extends TestSWCommand {
|
||||
}
|
||||
|
||||
@Register
|
||||
public void argument(String sender, double d, double d2) {
|
||||
public void argument(String sender, double d, double d2, double d3, double d4) {
|
||||
throw new ExecutionIdentifier("RunArgument with Double");
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class ArgumentCommandTest {
|
||||
public void testDouble() {
|
||||
ArgumentCommand cmd = new ArgumentCommand();
|
||||
try {
|
||||
cmd.execute("test", "", new String[]{"0.0", "0.0"});
|
||||
cmd.execute("test", "", new String[]{"0.0", "0.0", "0.0", "0.0"});
|
||||
} catch (Exception e) {
|
||||
assertCMDFramework(e, ExecutionIdentifier.class, "RunArgument with Double");
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren