blob: 7e90252cce50d408e51b8b48f27f0fe3278a143e (
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 SaveOnCommand extends VanillaCommand {
public SaveOnCommand() {
super("save-on");
this.description = "Enables server autosaving";
this.usageMessage = "/save-on";
this.setPermission("bukkit.command.save.enable");
}
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!testPermission(sender)) return true;
Command.broadcastCommandMessage(sender, "Enabling level saving..");
for (World world : Bukkit.getWorlds()) {
world.setAutoSave(true);
}
return true;
}
@Override
public boolean matches(String input) {
return input.equalsIgnoreCase("save-on");
}
}
|