[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 @Singleton
@Named("mainCommand") @Named("mainCommand")
CommandNode provideMainCommand(PlanCommand command) { CommandNode provideMainCommand(PlanCommand command) {
command.registerCommands();
return command; 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"); logger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable(); onDisable();
} }
registerCommand("plan", component.planCommand()); PlanCommand command = component.planCommand();
command.registerCommands();
registerCommand("plan", command);
} }
@Override @Override

View File

@ -69,7 +69,6 @@ class BungeePlanModule {
@Singleton @Singleton
@Named("mainCommand") @Named("mainCommand")
CommandNode provideMainCommand(PlanBungeeCommand command) { CommandNode provideMainCommand(PlanBungeeCommand command) {
command.registerCommands();
return command; 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"); logger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable(); onDisable();
} }
registerCommand("planbungee", component.planCommand()); PlanBungeeCommand command = component.planCommand();
command.registerCommands();
registerCommand("planbungee", command);
} }
@Override @Override

View File

@ -76,7 +76,6 @@ class SpongePlanModule {
@Singleton @Singleton
@Named("mainCommand") @Named("mainCommand")
CommandNode provideMainCommand(PlanCommand command) { CommandNode provideMainCommand(PlanCommand command) {
command.registerCommands();
return command; 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"); slf4jLogger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable(); onDisable();
} }
registerCommand("plan", component.planCommand()); PlanCommand command = component.planCommand();
command.registerCommands();
registerCommand("plan", command);
} }
@Override @Override

View File

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

View File

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