Skip to content

Commit

Permalink
Fix regen command syntax description and minor notes
Browse files Browse the repository at this point in the history
  • Loading branch information
benwoo1110 committed Jan 2, 2025
1 parent 88171da commit 8fdb137
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RegenCommand extends CoreCommand {
@Subcommand("regen")
@CommandPermission("multiverse.core.regen")
@CommandCompletion("@mvworlds:scope=loaded @flags:groupName=mvregencommand")
@Syntax("<world> --seed [seed] --keep-gamerules")
@Syntax("<world> [--seed [seed] --reset-world-config --reset-gamerules --reset-world-border --remove-players]")
@Description("{@@mv-core.regen.description}")
void onRegenCommand(
MVCommandIssuer issuer,
Expand All @@ -84,7 +84,7 @@ void onRegenCommand(
LoadedMultiverseWorld world,

@Optional
@Syntax("--seed [seed] --reset-gamerules")
@Syntax("[--seed [seed] --reset-world-config --reset-gamerules --reset-world-border --remove-players]")
@Description("{@@mv-core.regen.other.description}")
String[] flags) {
ParsedCommandFlags parsedFlags = parseFlags(flags);
Expand All @@ -104,6 +104,7 @@ private void runRegenCommand(MVCommandIssuer issuer, LoadedMultiverseWorld world
? playerWorldTeleporter.removeFromWorld(world)
: Async.completedFuture(Collections.emptyList());

// todo: using future will hide stacktrace
future.thenRun(() -> doWorldRegening(issuer, world, parsedFlags, worldPlayers));
}

Expand All @@ -126,7 +127,7 @@ private void doWorldRegening(
playerWorldTeleporter.teleportPlayersToWorld(worldPlayers, newWorld);
}
}).onFailure(failure -> {
Logging.fine("World regen failure: " + failure);
Logging.warning("World regen failure: " + failure);
issuer.sendError(failure.getFailureMessage());
});
}
Expand Down

0 comments on commit 8fdb137

Please sign in to comment.