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:
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
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.
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
