mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-26 04:25:37 +01:00
Minor cleanup to modify command.
This commit is contained in:
parent
b73a4e552f
commit
c874a98bac
@ -83,7 +83,7 @@ public class ModifyCommand extends MultiverseCommand {
|
|||||||
|
|
||||||
sender.sendMessage(String.format("%sSuccess! %sProperty %s%s %swas set to %s%s%s.",
|
sender.sendMessage(String.format("%sSuccess! %sProperty %s%s %swas set to %s%s%s.",
|
||||||
ChatColor.GREEN, ChatColor.WHITE, ChatColor.AQUA, property, ChatColor.WHITE, ChatColor.GREEN, value, ChatColor.WHITE));
|
ChatColor.GREEN, ChatColor.WHITE, ChatColor.AQUA, property, ChatColor.WHITE, ChatColor.GREEN, value, ChatColor.WHITE));
|
||||||
saveWorldConfig(sender);
|
saveWorldConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subcommand("add")
|
@Subcommand("add")
|
||||||
@ -114,7 +114,7 @@ public class ModifyCommand extends MultiverseCommand {
|
|||||||
sender.sendMessage(String.format("%sSuccess! %s%s%s was added to %s%s%s.",
|
sender.sendMessage(String.format("%sSuccess! %s%s%s was added to %s%s%s.",
|
||||||
ChatColor.GREEN, ChatColor.AQUA, value, ChatColor.WHITE, ChatColor.GREEN, property, ChatColor.WHITE));
|
ChatColor.GREEN, ChatColor.AQUA, value, ChatColor.WHITE, ChatColor.GREEN, property, ChatColor.WHITE));
|
||||||
|
|
||||||
saveWorldConfig(sender);
|
saveWorldConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subcommand("remove")
|
@Subcommand("remove")
|
||||||
@ -145,7 +145,7 @@ public class ModifyCommand extends MultiverseCommand {
|
|||||||
sender.sendMessage(String.format("%sSuccess! %s%s%s was %sremoved %sfrom %s%s%s.",
|
sender.sendMessage(String.format("%sSuccess! %s%s%s was %sremoved %sfrom %s%s%s.",
|
||||||
ChatColor.GREEN, ChatColor.AQUA, value, ChatColor.WHITE, ChatColor.RED, ChatColor.WHITE, ChatColor.GREEN, property, ChatColor.WHITE));
|
ChatColor.GREEN, ChatColor.AQUA, value, ChatColor.WHITE, ChatColor.RED, ChatColor.WHITE, ChatColor.GREEN, property, ChatColor.WHITE));
|
||||||
|
|
||||||
saveWorldConfig(sender);
|
saveWorldConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subcommand("clear")
|
@Subcommand("clear")
|
||||||
@ -171,7 +171,7 @@ public class ModifyCommand extends MultiverseCommand {
|
|||||||
sender.sendMessage(String.format("%s%s%s was cleared. It contains 0 values now.",
|
sender.sendMessage(String.format("%s%s%s was cleared. It contains 0 values now.",
|
||||||
ChatColor.GOLD, property, ChatColor.WHITE));
|
ChatColor.GOLD, property, ChatColor.WHITE));
|
||||||
|
|
||||||
saveWorldConfig(sender);
|
saveWorldConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subcommand("list")
|
@Subcommand("list")
|
||||||
@ -217,7 +217,7 @@ public class ModifyCommand extends MultiverseCommand {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveWorldConfig(@NotNull CommandSender sender) {
|
private void saveWorldConfig() {
|
||||||
if (!this.plugin.saveWorldConfig()) {
|
if (!this.plugin.saveWorldConfig()) {
|
||||||
throw new InvalidCommandArgument("There was an issue saving worlds.yml! Your changes will only be temporary.", false);
|
throw new InvalidCommandArgument("There was an issue saving worlds.yml! Your changes will only be temporary.", false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user