Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import java.io.File;
- public class StopCommand implements CommandExecutor {
- private Main plugin;
- public StopCommand(Main plugin){
- this.plugin=plugin;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command command, String lable, String[] args) {
- if (args.length<1){
- return false;
- }
- Thread deleteworldthread = new Thread(new Runnable() {
- public void run() {
- String world = plugin.worldType.get(Bukkit.getPlayer(args[0]).getWorld().getName());
- World mainworld = Bukkit.getPlayer(args[0]).getWorld();
- Bukkit.getPlayer(args[0]).teleport(new Location(Bukkit.getWorld("zona"), plugin.getConfig().getInt(world + ".backx"), plugin.getConfig().getInt(world + ".backy"), plugin.getConfig().getInt(world + ".backz")));
- if (mainworld.getPlayers().isEmpty()) {
- File deleteFolder = mainworld.getWorldFolder();
- new worlddelet(plugin).deleteWorld(deleteFolder, mainworld.getName());
- }
- }
- });
- deleteworldthread.start();
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement