mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-10-04 09:57:29 +02:00
Fixes #214
This commit is contained in:
parent
d0b5dab2a0
commit
600219eb08
@ -36,7 +36,6 @@ import com.sk89q.worldedit.util.command.binding.StandardBindings;
|
|||||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||||
import com.thoughtworks.paranamer.CachingParanamer;
|
import com.thoughtworks.paranamer.CachingParanamer;
|
||||||
import com.thoughtworks.paranamer.Paranamer;
|
import com.thoughtworks.paranamer.Paranamer;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
@ -45,6 +44,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -155,6 +155,7 @@ public class ParametricBuilder {
|
|||||||
for (Method method : object.getClass().getDeclaredMethods()) {
|
for (Method method : object.getClass().getDeclaredMethods()) {
|
||||||
Command definition = method.getAnnotation(Command.class);
|
Command definition = method.getAnnotation(Command.class);
|
||||||
if (definition != null) {
|
if (definition != null) {
|
||||||
|
definition = Commands.translate(definition);
|
||||||
CommandCallable callable = build(object, method, definition);
|
CommandCallable callable = build(object, method, definition);
|
||||||
dispatcher.registerCommand(callable, definition.aliases());
|
dispatcher.registerCommand(callable, definition.aliases());
|
||||||
}
|
}
|
||||||
@ -176,7 +177,7 @@ public class ParametricBuilder {
|
|||||||
Class<?> clazz = Class.forName("com.sk89q.worldedit.util.command.parametric.ParametricCallable");
|
Class<?> clazz = Class.forName("com.sk89q.worldedit.util.command.parametric.ParametricCallable");
|
||||||
Constructor<?> constructor = clazz.getDeclaredConstructors()[0];
|
Constructor<?> constructor = clazz.getDeclaredConstructors()[0];
|
||||||
constructor.setAccessible(true);
|
constructor.setAccessible(true);
|
||||||
return (CommandCallable) constructor.newInstance(this, object, method, Commands.translate(definition));
|
return (CommandCallable) constructor.newInstance(this, object, method, definition);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (e instanceof ParametricException) {
|
if (e instanceof ParametricException) {
|
||||||
throw (ParametricException) e;
|
throw (ParametricException) e;
|
||||||
|
Loading…
Reference in New Issue
Block a user