| 6 | import org.bukkit.command.CommandSender; |
| 7 | |
| 8 | public class SaveOnCommand extends VanillaCommand { |
| 9 | public SaveOnCommand() { |
| 10 | super("save-on"); |
| 11 | this.description = "Enables server autosaving"; |
| 12 | this.usageMessage = "/save-on"; |
| 13 | this.setPermission("bukkit.command.save.enable"); |
| 14 | } |
| 15 | |
| 16 | @Override |
| 17 | public boolean execute(CommandSender sender, String currentAlias, String[] args) { |
| 18 | if (!testPermission(sender)) return true; |
| 19 | |
| 20 | Command.broadcastCommandMessage(sender, "Enabling level saving.."); |
| 21 | |
| 22 | for (World world : Bukkit.getWorlds()) { |
| 23 | world.setAutoSave(true); |
| 24 | } |
| 25 | |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | public boolean matches(String input) { |
| 31 | return input.startsWith("save-on"); |
| 32 | } |
| 33 | } |
nothing calls this directly
no outgoing calls
no test coverage detected