Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.IOException;
- import me.assist.playerrealms.DefaultWorldGenerator;
- import org.bukkit.Bukkit;
- import org.bukkit.World;
- import com.google.common.io.Files;
- public class RealmCreator {
- String worldName = "null";
- public RealmCreator(String worldName) {
- this.worldName = worldName;
- }
- public void generateRealm() {
- File dir = new File(".").getAbsoluteFile();
- World defWorld = Bukkit.getWorld("prDefWorld");
- if (defWorld != null) {
- File def = defWorld.getWorldFolder();
- try {
- Files.copy(def, new File(dir.getPath(), worldName));
- } catch (IOException e) {
- e.printStackTrace();
- }
- } else {
- new DefaultWorldGenerator().tryCreate();
- Bukkit.getLogger().info("Default world generated.");
- generateRealm();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement