refactor: remove useless class

This commit is contained in:
aro 2022-11-07 13:15:36 +01:00
parent 78b4725584
commit b150ae2875
4 changed files with 5 additions and 31 deletions

View file

@ -21,8 +21,8 @@ public class NickoCommand implements CommandExecutor {
if (sender instanceof Player player) {
if (args.length >= 1) {
switch (args[0]) {
case "debug" -> new NickoDebugSubCmd(this).execute(sender, args);
case "check" -> new NickoCheckSubCmd(this).execute(player, args);
case "debug" -> new NickoDebugSubCmd().execute(sender, args);
case "check" -> new NickoCheckSubCmd().execute(player, args);
default -> sendHelpMessages(sender);
}
return false;

View file

@ -1,7 +1,6 @@
package net.artelnatif.nicko.command.sub;
import net.artelnatif.nicko.NickoBukkit;
import net.artelnatif.nicko.command.NickoCommand;
import net.artelnatif.nicko.disguise.AppearanceManager;
import net.artelnatif.nicko.i18n.I18N;
import net.artelnatif.nicko.i18n.I18NDict;
@ -12,11 +11,7 @@ import org.bukkit.entity.Player;
import java.util.StringJoiner;
public class NickoCheckSubCmd extends NickoSubCmd {
public NickoCheckSubCmd(NickoCommand nickoCommand) {
super(nickoCommand);
}
public class NickoCheckSubCmd {
public void execute(Player player, String[] args) {
final String targetName = args[1];
final Player target = Bukkit.getPlayerExact(targetName);

View file

@ -1,7 +1,6 @@
package net.artelnatif.nicko.command.sub;
import net.artelnatif.nicko.NickoBukkit;
import net.artelnatif.nicko.command.NickoCommand;
import net.artelnatif.nicko.disguise.AppearanceManager;
import net.artelnatif.nicko.mojang.MojangUtils;
import net.artelnatif.nicko.utils.PlayerUtils;
@ -10,12 +9,7 @@ import org.bukkit.Sound;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class NickoDebugSubCmd extends NickoSubCmd {
public NickoDebugSubCmd(NickoCommand nickoCommand) {
super(nickoCommand);
}
public class NickoDebugSubCmd {
public void execute(CommandSender sender, String[] args) {
Player target;
String name, skin;

View file

@ -1,15 +0,0 @@
package net.artelnatif.nicko.command.sub;
import net.artelnatif.nicko.command.NickoCommand;
public class NickoSubCmd {
private final NickoCommand nickoCommand;
public NickoSubCmd(NickoCommand nickoCommand) {
this.nickoCommand = nickoCommand;
}
public NickoCommand getMainCommand() {
return nickoCommand;
}
}