mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-05 02:09:50 +01: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;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user