Clean up some command code smells

This commit is contained in:
Rsl1122 2018-05-25 23:29:05 +03:00
parent efe4251359
commit ce385b8294
2 changed files with 1 additions and 13 deletions

View File

@ -4,7 +4,6 @@
*/ */
package com.djrapitops.plan.command.commands; package com.djrapitops.plan.command.commands;
import com.djrapitops.plan.system.info.connection.ConnectionSystem;
import com.djrapitops.plan.system.settings.locale.Locale; import com.djrapitops.plan.system.settings.locale.Locale;
import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.system.settings.locale.Msg;
import com.djrapitops.plugin.command.CommandNode; import com.djrapitops.plugin.command.CommandNode;
@ -29,16 +28,6 @@ public class DevCommand extends CommandNode {
public void onCommand(ISender sender, String cmd, String[] args) { public void onCommand(ISender sender, String cmd, String[] args) {
Verify.isTrue(args.length >= 1, () -> new IllegalArgumentException(Locale.get(Msg.CMD_FAIL_REQ_ONE_ARG).toString())); Verify.isTrue(args.length >= 1, () -> new IllegalArgumentException(Locale.get(Msg.CMD_FAIL_REQ_ONE_ARG).toString()));
String feature = args[0]; sender.sendMessage("No features currently implemented in the command.");
switch (feature) {
case "web":
ConnectionSystem connectionSystem = ConnectionSystem.getInstance();
String accessAddress = connectionSystem.getMainAddress();
sender.sendMessage((connectionSystem.isServerAvailable())
? "Bungee: " + accessAddress : "Local: " + accessAddress);
break;
default:
break;
}
} }
} }

View File

@ -77,7 +77,6 @@ public class RegisterCommand extends CommandNode {
} }
private void playerRegister(String[] args, ISender sender) throws PassEncryptUtil.CannotPerformOperationException { private void playerRegister(String[] args, ISender sender) throws PassEncryptUtil.CannotPerformOperationException {
final String notEnoughArgsMsg = Locale.get(Msg.CMD_FAIL_REQ_ARGS).parse("(1 or 3) " + Arrays.toString(this.getArguments()));
boolean registerSenderAsUser = args.length == 1; boolean registerSenderAsUser = args.length == 1;
if (registerSenderAsUser) { if (registerSenderAsUser) {
String user = sender.getName(); String user = sender.getName();