Removed old PlanCommand classes

This commit is contained in:
Risto Lahtela 2020-08-30 22:39:24 +03:00
parent 5ebc722d43
commit 7087aa2f78
9 changed files with 3 additions and 196 deletions

View File

@ -18,13 +18,9 @@ package com.djrapitops.plan.modules.bukkit;
import com.djrapitops.plan.Plan;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.commands.OldPlanCommand;
import com.djrapitops.plugin.command.CommandNode;
import dagger.Binds;
import dagger.Module;
import javax.inject.Named;
/**
* Dagger module for binding Plan instance.
*
@ -35,8 +31,4 @@ public interface BukkitPlanModule {
@Binds
PlanPlugin bindPlanPlugin(Plan plugin);
@Binds
@Named("mainCommand")
CommandNode bindMainCommand(OldPlanCommand command);
}

View File

@ -18,13 +18,9 @@ package com.djrapitops.plan.modules.bungee;
import com.djrapitops.plan.PlanBungee;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.commands.PlanProxyCommand;
import com.djrapitops.plugin.command.CommandNode;
import dagger.Binds;
import dagger.Module;
import javax.inject.Named;
/**
* Dagger module for binding PlanBungee instance.
*
@ -36,7 +32,4 @@ public interface BungeePlanModule {
@Binds
PlanPlugin bindPlanPlugin(PlanBungee plugin);
@Binds
@Named("mainCommand")
CommandNode bindMainCommand(PlanProxyCommand command);
}

View File

@ -1,65 +0,0 @@
/*
* This file is part of Player Analytics (Plan).
*
* Plan is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License v3 as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Plan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
*/
package com.djrapitops.plan.commands;
import com.djrapitops.plan.settings.Permissions;
import com.djrapitops.plan.settings.locale.Locale;
import com.djrapitops.plan.settings.locale.lang.DeepHelpLang;
import com.djrapitops.plugin.command.ColorScheme;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCmdNode;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* TreeCommand for the /plan command, and all SubCommands.
* <p>
* Uses the Abstract Plugin Framework for easier command management.
*
* @author Rsl1122
*/
@Singleton
public class OldPlanCommand extends TreeCmdNode {
private boolean commandsRegistered;
@Inject
public OldPlanCommand(
ColorScheme colorScheme,
Locale locale
// Group 1
// Group 2
// Group 3
) {
super("plan", "", CommandType.CONSOLE, null);
commandsRegistered = false;
getHelpCommand().setPermission(Permissions.HELP.getPermission());
setDefaultCommand("inspect");
setColorScheme(colorScheme);
setInDepthHelp(locale.getArray(DeepHelpLang.PLAN));
}
public void registerCommands() {
if (commandsRegistered) {
return;
}
commandsRegistered = true;
}
}

View File

@ -1,85 +0,0 @@
/*
* This file is part of Player Analytics (Plan).
*
* Plan is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License v3 as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Plan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
*/
package com.djrapitops.plan.commands;
import com.djrapitops.plan.settings.Permissions;
import com.djrapitops.plan.settings.locale.Locale;
import com.djrapitops.plan.settings.locale.lang.DeepHelpLang;
import com.djrapitops.plugin.command.ColorScheme;
import com.djrapitops.plugin.command.CommandNode;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCmdNode;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
/**
* TreeCommand for the /plan command, and all subcommands.
* <p>
* Uses the Abstract Plugin Framework for easier command management.
*
* @author Rsl1122
*/
@Singleton
public class PlanProxyCommand extends TreeCmdNode {
private boolean commandsRegistered;
@Inject
public PlanProxyCommand(
@Named("mainCommandName") String mainCommandName,
ColorScheme colorScheme,
Locale locale
// Group 1
// Group 2
// Group 3
) {
super(mainCommandName, Permissions.MANAGE.getPermission(), CommandType.CONSOLE, null);
commandsRegistered = false;
getHelpCommand().setPermission(Permissions.MANAGE.getPermission());
setColorScheme(colorScheme);
setInDepthHelp(locale.getArray(DeepHelpLang.PLAN));
}
public void registerCommands() {
if (commandsRegistered) {
return;
}
CommandNode[] analyticsGroup = {
// networkCommand,
// listPlayersCommand,
// list servers
};
CommandNode[] webGroup = {
// registerCommand,
// unregisterCommand,
// webUserCommand.get()
};
CommandNode[] manageGroup = {
// rawDataCommand,
// uninstalledCommand,
//reloadCommand,
//disableCommand
};
setNodeGroups(analyticsGroup, webGroup, manageGroup);
commandsRegistered = true;
}
}

View File

@ -18,7 +18,7 @@ package utilities.dagger;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.PlanSystem;
import com.djrapitops.plan.commands.OldPlanCommand;
import com.djrapitops.plan.commands.PlanCommand;
import com.djrapitops.plan.modules.APFModule;
import com.djrapitops.plan.modules.PlaceholderModule;
import com.djrapitops.plan.modules.SystemObjectProvidingModule;
@ -43,7 +43,7 @@ import javax.inject.Singleton;
PluginSuperClassBindingModule.class
})
public interface PlanPluginComponent {
OldPlanCommand planCommand();
PlanCommand planCommand();
PlanSystem system();

View File

@ -16,19 +16,15 @@
*/
package utilities.dagger;
import com.djrapitops.plan.commands.OldPlanCommand;
import com.djrapitops.plan.gathering.importing.EmptyImportSystem;
import com.djrapitops.plan.gathering.importing.ImportSystem;
import com.djrapitops.plan.identification.ServerInfo;
import com.djrapitops.plan.identification.ServerServerInfo;
import com.djrapitops.plan.settings.BukkitConfigSystem;
import com.djrapitops.plan.settings.ConfigSystem;
import com.djrapitops.plugin.command.CommandNode;
import dagger.Binds;
import dagger.Module;
import javax.inject.Named;
/**
* Dagger module for binding Plan instance.
*
@ -37,10 +33,6 @@ import javax.inject.Named;
@Module
public interface PlanPluginModule {
@Binds
@Named("mainCommand")
CommandNode bindMainCommand(OldPlanCommand command);
@Binds
ImportSystem bindImportSystem(EmptyImportSystem emptyImportSystem);
@ -49,4 +41,5 @@ public interface PlanPluginModule {
@Binds
ServerInfo bindServerInfo(ServerServerInfo serverServerInfo);
}

View File

@ -18,13 +18,9 @@ package com.djrapitops.plan.modules.nukkit;
import com.djrapitops.plan.PlanNukkit;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.commands.OldPlanCommand;
import com.djrapitops.plugin.command.CommandNode;
import dagger.Binds;
import dagger.Module;
import javax.inject.Named;
/**
* Dagger module for binding Plan instance.
*
@ -36,7 +32,4 @@ public interface NukkitPlanModule {
@Binds
PlanPlugin bindPlanPlugin(PlanNukkit plugin);
@Binds
@Named("mainCommand")
CommandNode bindMainCommand(OldPlanCommand command);
}

View File

@ -18,13 +18,9 @@ package com.djrapitops.plan.modules.sponge;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.PlanSponge;
import com.djrapitops.plan.commands.OldPlanCommand;
import com.djrapitops.plugin.command.CommandNode;
import dagger.Binds;
import dagger.Module;
import javax.inject.Named;
/**
* Dagger module for binding PlanSponge instance.
*
@ -36,7 +32,4 @@ public interface SpongePlanModule {
@Binds
PlanPlugin bindPlanPlugin(PlanSponge plugin);
@Binds
@Named("mainCommand")
CommandNode bindMainCommand(OldPlanCommand command);
}

View File

@ -18,13 +18,9 @@ package com.djrapitops.plan.modules.velocity;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.PlanVelocity;
import com.djrapitops.plan.commands.PlanProxyCommand;
import com.djrapitops.plugin.command.CommandNode;
import dagger.Binds;
import dagger.Module;
import javax.inject.Named;
/**
* Dagger module for binding PlanVelocity instance.
*
@ -36,7 +32,4 @@ public interface VelocityPlanModule {
@Binds
PlanPlugin providePlanPlugin(PlanVelocity plugin);
@Binds
@Named("mainCommand")
CommandNode provideMainCommand(PlanProxyCommand command);
}