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.");
}
}
Aggregations