Skip to content

Commit

Permalink
Having multiple classes named the same thing is a bad idea for me
Browse files Browse the repository at this point in the history
  • Loading branch information
RhythmicSys committed Jun 13, 2023
1 parent 9644506 commit 7d7dc7c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
15 changes: 8 additions & 7 deletions src/main/java/simplexity/villagerinfo/VillagerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import org.bukkit.entity.Villager;
import org.bukkit.plugin.java.JavaPlugin;
import org.objectweb.asm.commons.Method;
import simplexity.villagerinfo.commands.VillReload;
import simplexity.villagerinfo.commands.VillReloadCommand;
import simplexity.villagerinfo.commands.util.SubCommand;
import simplexity.villagerinfo.commands.util.SubCommandMaps;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.Help;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.toggle.Toggle;
import simplexity.villagerinfo.commands.villagerinfo.VillagerInfoCommand;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.HelpCommand;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.toggle.ToggleCommand;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.toggle.subcommands.HighlightToggle;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.toggle.subcommands.OutputToggle;
import simplexity.villagerinfo.commands.villagerinfo.subcommands.toggle.subcommands.SoundToggle;
Expand Down Expand Up @@ -69,8 +70,8 @@ public void reloadVillInfoConfigs() {
}

public void registerCommands() {
Objects.requireNonNull(this.getCommand("villreload")).setExecutor(new VillReload());
Objects.requireNonNull(this.getCommand("villagerinfo")).setExecutor(new VillagerInfo());
Objects.requireNonNull(this.getCommand("villreload")).setExecutor(new VillReloadCommand());
Objects.requireNonNull(this.getCommand("villagerinfo")).setExecutor(new VillagerInfoCommand());
populateToggleSubcommands();
populateVillagerInfoSubCommands();
}
Expand All @@ -84,8 +85,8 @@ public void populateToggleSubcommands() {

public void populateVillagerInfoSubCommands() {
HashMap<String, SubCommand> commandMap = SubCommandMaps.getInstance().getVillagerInfoSubCommands();
commandMap.put("help", new Help());
commandMap.put("toggle", new Toggle());
commandMap.put("help", new HelpCommand());
commandMap.put("toggle", new ToggleCommand());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import simplexity.villagerinfo.configurations.locale.ServerMessage;
import simplexity.villagerinfo.util.Resolvers;

public class VillReload implements CommandExecutor {
public class VillReloadCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
VillagerInfo.getInstance().reloadConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.HashMap;
import java.util.List;

public class VillagerInfo implements TabExecutor {
public class VillagerInfoCommand implements TabExecutor {
List<String> villagerInfoTabComplete = new ArrayList<>();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import java.util.ArrayList;
import java.util.List;

public class Help extends SubCommand {
public Help() {
public class HelpCommand extends SubCommand {
public HelpCommand() {
super(Perm.VILL_COMMAND_BASE.getPerm(), ServerMessage.HELP_MAIN.getMessage());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import java.util.HashMap;
import java.util.List;

public class Toggle extends SubCommand {
public class ToggleCommand extends SubCommand {
List<String> tabCompleteList = new ArrayList<>();

public Toggle() {
public ToggleCommand() {
super(Perm.VILL_COMMAND_TOGGLE.getPerm(), ServerMessage.HELP_TOGGLE_BASE.getMessage());
}

Expand Down

0 comments on commit 7d7dc7c

Please sign in to comment.