Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package games.coob.skywars.command;
- import games.coob.skywars.model.GameMap;
- import games.coob.skywars.model.LocalGameMap;
- import lombok.SneakyThrows;
- import org.bukkit.entity.Player;
- import org.mineacademy.fo.plugin.SimplePlugin;
- import org.mineacademy.fo.remain.Remain;
- import java.io.File;
- public class RestoreCommand extends SkyWarsSubCommand {
- protected RestoreCommand() {
- super("restore", "Restore the world");
- }
- @SneakyThrows
- @Override
- protected void onCommand() {
- checkConsole();
- for (final Player player : Remain.getOnlinePlayers())
- player.kickPlayer("World is getting restored.");
- final File gameMapsFolder = new File(SimplePlugin.getInstance().getDataFolder(), "gameMaps");
- if (!gameMapsFolder.exists())
- gameMapsFolder.mkdirs();
- final GameMap map = new LocalGameMap(gameMapsFolder, "lucky", true);
- map.restoreFromSource();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement