blob: 67f9b40718fc98a8e1ed79cf27ab55a15fa561af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package org.bukkit.command.defaults;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
public class SaveOffCommand extends VanillaCommand {
public SaveOffCommand() {
super("save-off");
this.description = "Disables server autosaving";
this.usageMessage = "/save-off";
this.setPermission("bukkit.command.save.disable");
}
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!testPermission(sender)) return true;
Command.broadcastCommandMessage(sender, "Disabling level saving..");
for (World world : Bukkit.getWorlds()) {
world.setAutoSave(false);
}
return true;
}
@Override
public boolean matches(String input) {
return input.startsWith("save-off");
}
}
|