Skip to content

Commit

Permalink
fixed out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
ezTxmMC committed Jan 2, 2025
1 parent d2661dd commit 18f98ed
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,35 @@ public void start() {
switch (command) {
case "clear" -> this.clear();
case "create" -> {
if (args.length < 1) {
this.print("Usage: create server <method> <options...>");
continue;
}
switch (args[0].toLowerCase()) {
case "server" -> {
if (args.length < 2) {
this.print("Usage: create server <method> <options...>");
return;
continue;
}
if (args[1].equalsIgnoreCase("template")) {
if (args.length < 3) {
this.print("Usage: create server template <template>");
return;
continue;
}
Lobbyserver.getInstance().getDatabaseProcessor().addServer(
UUID.fromString("b8309d91-e43b-4e17-955d-ca09a056dc7d"),
Server.getFromTemplate(ServerTemplate.valueOf(args[2].toUpperCase())));
return;
continue;
}
if (args[1].equalsIgnoreCase("custom")) {
if (args.length < 5) {
this.print("Usage: create server custom <options...>");
return;
continue;
}
Lobbyserver.getInstance().getDatabaseProcessor().addServer(
UUID.fromString("b8309d91-e43b-4e17-955d-ca09a056dc7d"),
new Server(0, 0, 0, new ArrayList<>()));
return;
continue;
}
this.print("Usage: create server <method> <options...>");
}
Expand Down

0 comments on commit 18f98ed

Please sign in to comment.