mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-08-20 11:42:50 +02:00
Clean up some command code smells
This commit is contained in:
parent
efe4251359
commit
ce385b8294
|
@ -4,7 +4,6 @@
|
|||
*/
|
||||
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.Msg;
|
||||
import com.djrapitops.plugin.command.CommandNode;
|
||||
|
@ -29,16 +28,6 @@ public class DevCommand extends CommandNode {
|
|||
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()));
|
||||
|
||||
String feature = args[0];
|
||||
switch (feature) {
|
||||
case "web":
|
||||
ConnectionSystem connectionSystem = ConnectionSystem.getInstance();
|
||||
String accessAddress = connectionSystem.getMainAddress();
|
||||
sender.sendMessage((connectionSystem.isServerAvailable())
|
||||
? "Bungee: " + accessAddress : "Local: " + accessAddress);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sender.sendMessage("No features currently implemented in the command.");
|
||||
}
|
||||
}
|
|
@ -77,7 +77,6 @@ public class RegisterCommand extends CommandNode {
|
|||
}
|
||||
|
||||
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;
|
||||
if (registerSenderAsUser) {
|
||||
String user = sender.getName();
|
||||
|
|
Loading…
Reference in New Issue
Block a user