mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 02:25:41 +01:00
Merge pull request #2949 from Multiverse/fix-regen-args
Fix regen args parsing logic
This commit is contained in:
commit
5fbe16ed5a
@ -40,10 +40,13 @@ public class RegenCommand extends MultiverseCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void runCommand(CommandSender sender, List<String> args) {
|
public void runCommand(CommandSender sender, List<String> args) {
|
||||||
String worldName = args.get(0);
|
String worldName = args.get(0);
|
||||||
boolean useseed = (!(args.size() == 1));
|
boolean useseed = CommandHandler.hasFlag("-s", args);
|
||||||
boolean randomseed = (args.size() == 2 && args.get(1).equalsIgnoreCase("-s"));
|
String seedflag = CommandHandler.getFlag("-s", args);
|
||||||
String seed = (args.size() == 3) ? args.get(2) : "";
|
|
||||||
boolean keepGamerules = CommandHandler.hasFlag("--keep-gamerules", args);
|
boolean keepGamerules = CommandHandler.hasFlag("--keep-gamerules", args);
|
||||||
|
|
||||||
|
boolean randomseed = seedflag == null || seedflag.isEmpty() || seedflag.equalsIgnoreCase("--keep-gamerules");
|
||||||
|
String seed = randomseed ? "" : seedflag;
|
||||||
|
|
||||||
this.plugin.getCommandQueueManager().addToQueue(new QueuedCommand(
|
this.plugin.getCommandQueueManager().addToQueue(new QueuedCommand(
|
||||||
sender,
|
sender,
|
||||||
doWorldRegen(sender, worldName, useseed, randomseed, seed, keepGamerules),
|
doWorldRegen(sender, worldName, useseed, randomseed, seed, keepGamerules),
|
||||||
|
Loading…
Reference in New Issue
Block a user