use of com.sk89q.worldedit.bukkit.adapter.AdapterLoadException in project FastAsyncWorldEdit by IntellectualSites.
the class WorldEditPlugin method loadAdapter.
// FAWE end
private void loadAdapter() {
WorldEdit worldEdit = WorldEdit.getInstance();
// Attempt to load a Bukkit adapter
BukkitImplLoader adapterLoader = new BukkitImplLoader();
try {
adapterLoader.addFromPath(getClass().getClassLoader());
} catch (IOException e) {
LOGGER.warn("Failed to search path for Bukkit adapters");
}
try {
adapterLoader.addFromJar(getFile());
} catch (IOException e) {
LOGGER.warn("Failed to search " + getFile() + " for Bukkit adapters", e);
}
try {
BukkitImplAdapter bukkitAdapter = adapterLoader.loadAdapter();
LOGGER.info("Using " + bukkitAdapter.getClass().getCanonicalName() + " as the Bukkit adapter");
this.adapter.newValue(bukkitAdapter);
} catch (AdapterLoadException e) {
Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING);
if (platform instanceof BukkitServerInterface) {
LOGGER.warn(e.getMessage());
} else {
// FAWE start - Identify as FAWE
LOGGER.info("FastAsyncWorldEdit could not find a Bukkit adapter for this MC version, " + "but it seems that you have another implementation of FastAsyncWorldEdit installed ({}) " + "that handles the world editing.", platform.getPlatformName());
// FAWE end
}
this.adapter.invalidate();
}
}
Aggregations