Help with schematic/world loading

Status
This thread has been locked.

longdog

Supreme
Feedback score
8
Posts
338
Reactions
179
Resources
0
I'm trying to either paste a schematic in a world, or copy the entire world to a new one. My code for world copying is this:
Code:
public static void copyWorld(File source, File target){
    try {
        ArrayList<String> ignore = new ArrayList<String>(Arrays.asList("uid.dat", "session.dat"));
        if(!ignore.contains(source.getName())) {
            if(source.isDirectory()) {
                if(!target.exists())
                    target.mkdirs();
                String files[] = source.list();
                for (String file : files) {
                    File srcFile = new File(source, file);
                    File destFile = new File(target, file);
                    copyWorld(srcFile, destFile);
                }
            } else {
                InputStream in = new FileInputStream(source);
                OutputStream out = new FileOutputStream(target);
                byte[] buffer = new byte[1024];
                int length;
                while ((length = in.read(buffer)) > 0)
                    out.write(buffer, 0, length);
                in.close();
                out.close();
            }
        }
    } catch (IOException e) {

    }
}

I use that and it overwrites the void world I generated, but sometimes it either doesn't work at all, or it does this: https://cdn.discordapp.com/attachments/639538441712828446/671498273512488989/unknown.png

I also tried using fawe api, using the following code
Code:
EditSession editSession = ClipboardFormats.findByFile(new File("plugins/WorldEdit/schematics/meetup1.schematic")).load(new File("plugins/WorldEdit/schematics/meetup1.schematic")).paste(new BukkitWorld(Bukkit.getWorld(wName)), BlockVector3.at(125, 40, -55), allowUndo, false, (Transform) null);

but that just throws this error: https://hastebin.com/ivakadakiy.rb

Please help me with this, I would rather use the fawe api as it is much more efficient to load a void world and paste the schematic, but apparently there is an issue with their api currently. I am using version 1.8.8 foxspigot.
 
Type
Requesting
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

PlumpOrange

Feedback score
0
Posts
16
Reactions
10
Resources
0
Idk why you are posting that on market channels, but why would you want to do this in the first place? Worledit/FAWE allows this by default in their plugins. I'de recommend taking this to spigot forums to get further help on it, but good luck.
 

longdog

Supreme
Feedback score
8
Posts
338
Reactions
179
Resources
0
Idk why you are posting that on market channels, but why would you want to do this in the first place? Worledit/FAWE allows this by default in their plugins. I'de recommend taking this to spigot forums to get further help on it, but good luck.
This is the Minecraft plugin development section, also the right place to ask for assistance. I’m trying to do this through my own plugin but I already figured it out anyways.
 
Status
This thread has been locked.
Top