[Fix] Fix Command registration

Issue was caused by no call to registerCommands was made at runtime.
This commit is contained in:
Rsl1122 2018-10-07 16:17:06 +03:00
parent 7f9146fcf4
commit ade810ca8c
5 changed files with 13 additions and 6 deletions

View File

@ -88,7 +88,6 @@ class BukkitPlanModule {
@Singleton
@Named("mainCommand")
CommandNode provideMainCommand(PlanCommand command) {
command.registerCommands();
return command;
}
}
@ -132,7 +131,9 @@ public class Plan extends BukkitPlugin implements PlanPlugin {
logger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable();
}
registerCommand("plan", component.planCommand());
PlanCommand command = component.planCommand();
command.registerCommands();
registerCommand("plan", command);
}
@Override

View File

@ -69,7 +69,6 @@ class BungeePlanModule {
@Singleton
@Named("mainCommand")
CommandNode provideMainCommand(PlanBungeeCommand command) {
command.registerCommands();
return command;
}
}
@ -113,7 +112,9 @@ public class PlanBungee extends BungeePlugin implements PlanPlugin {
logger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable();
}
registerCommand("planbungee", component.planCommand());
PlanBungeeCommand command = component.planCommand();
command.registerCommands();
registerCommand("planbungee", command);
}
@Override

View File

@ -76,7 +76,6 @@ class SpongePlanModule {
@Singleton
@Named("mainCommand")
CommandNode provideMainCommand(PlanCommand command) {
command.registerCommands();
return command;
}
}
@ -134,7 +133,9 @@ public class PlanSponge extends SpongePlugin implements PlanPlugin {
slf4jLogger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable();
}
registerCommand("plan", component.planCommand());
PlanCommand command = component.planCommand();
command.registerCommands();
registerCommand("plan", command);
}
@Override

View File

@ -13,6 +13,7 @@ import com.djrapitops.plugin.command.TreeCmdNode;
import dagger.Lazy;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* TreeCommand for the /plan command, and all subcommands.
@ -22,6 +23,7 @@ import javax.inject.Inject;
* @author Rsl1122
* @since 1.0.0
*/
@Singleton
public class PlanBungeeCommand extends TreeCmdNode {
private final NetworkCommand networkCommand;

View File

@ -12,6 +12,7 @@ import com.djrapitops.plugin.command.TreeCmdNode;
import dagger.Lazy;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* TreeCommand for the /plan command, and all SubCommands.
@ -21,6 +22,7 @@ import javax.inject.Inject;
* @author Rsl1122
* @since 1.0.0
*/
@Singleton
public class PlanCommand extends TreeCmdNode {
private final PlanConfig config;