Moved all vanilla commands into Bukkit
This commit is contained in:
@@ -0,0 +1,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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user