Speed up SWCommand registration
Dieser Commit ist enthalten in:
Ursprung
2adab560c2
Commit
96b7652324
@ -80,7 +80,8 @@ public abstract class SWCommand {
|
|||||||
unregister();
|
unregister();
|
||||||
register();
|
register();
|
||||||
|
|
||||||
for (Method method : getClass().getDeclaredMethods()) {
|
Method[] methods = getClass().getDeclaredMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
addMapper(Mapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> {
|
addMapper(Mapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> {
|
||||||
if (anno.local()) {
|
if (anno.local()) {
|
||||||
localTypeMapper.put(anno.value(), typeMapper);
|
localTypeMapper.put(anno.value(), typeMapper);
|
||||||
@ -112,7 +113,7 @@ public abstract class SWCommand {
|
|||||||
commandHelpSet.add(new SubCommand(this, method, anno.value(), new HashMap<>()));
|
commandHelpSet.add(new SubCommand(this, method, anno.value(), new HashMap<>()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (Method method : getClass().getDeclaredMethods()) {
|
for (Method method : methods) {
|
||||||
add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> {
|
add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> {
|
||||||
if (anno.help()) {
|
if (anno.help()) {
|
||||||
return;
|
return;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren