Skip to content
Jesse Boyd edited this page Aug 21, 2016 · 3 revisions

With FAWE installed, you can register a new ClipboardFormat through the API

ClipboardFormat.addFormat(new AbstractClipboardFormat("FAWE", "fawe") {
    @Override
    public ClipboardReader getReader(InputStream inputStream) throws IOException {
        return new FaweFormat(MainUtil.getCompressedIS(inputStream));
    }

    @Override
    public ClipboardWriter getWriter(OutputStream outputStream) throws IOException {
        return getWriter(outputStream, 8);
    }

    @Override
    public boolean isFormat(File file) {
        return file.getName().endsWith(".fawe") || file.getName().endsWith(".bd");
    }

    @Override
    public String getExtension() {
        return "fawe";
    }

    public ClipboardWriter getWriter(OutputStream os, int compression) throws IOException {
        FaweFormat writer = new FaweFormat(new FaweOutputStream(os));
        writer.compress(compression);
        return writer;
    }

    public DiskOptimizedClipboard getUncompressedReadWrite(File file) throws IOException {
        return new DiskOptimizedClipboard(file);
    }

    public DiskOptimizedClipboard createUncompressedReadWrite(int width, int height, int length, File file) {
        return new DiskOptimizedClipboard(width, height, length, file);
    }
});

The format will then be usable ingame: //schem load <format> <file>

This Wiki is for Legacy Versions (1.8 - 1.12.2). Check here for 1.13+ versions: https://github.com/IntellectualSites/FastAsyncWorldEdit-Documentation/

Clone this wiki locally