Search in sources :

Example 1 with ResourceLoader

use of com.sk89q.worldedit.util.io.ResourceLoader in project FastAsyncWorldEdit by IntellectualSites.

the class FileRegistries method loadDataFiles.

public void loadDataFiles() {
    ResourceLoader resourceLoader = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.CONFIGURATION).getResourceLoader();
    try {
        URL url = resourceLoader.getResource(FileRegistries.class, app.getPlatform().getDataVersion() + ".json");
        this.dataFile = gson.fromJson(Resources.toString(url, StandardCharsets.UTF_8), DataFile.class);
    } catch (IOException e) {
        throw new RuntimeException("The provided file is not compatible with this version of WorldEdit-CLI. Please update or report this.");
    }
}
Also used : ResourceLoader(com.sk89q.worldedit.util.io.ResourceLoader) IOException(java.io.IOException) URL(java.net.URL)

Aggregations

ResourceLoader (com.sk89q.worldedit.util.io.ResourceLoader)1 IOException (java.io.IOException)1 URL (java.net.URL)1