mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-23 18:55:14 +01:00
Fix plugin crash caused by SkinsRestorer integration
SkinsRestorer integration now just shows warning instead of plugin crash when SkinsRestorer not installed and integration enabled
This commit is contained in:
parent
ef2a45ab2a
commit
c7cb56bc1d
@ -899,15 +899,18 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
}
|
||||
|
||||
/* Skins support via SkinsRestorer */
|
||||
SkinsRestorer skinsRestorer = null;
|
||||
|
||||
if (core.configuration.getBoolean("skinsrestorer-integration", false))
|
||||
skinsRestorer = JavaPlugin.getPlugin(SkinsRestorer.class);
|
||||
|
||||
SkinsRestorerSkinUrlProvider skinUrlProvider = null;
|
||||
|
||||
if (skinsRestorer != null)
|
||||
skinUrlProvider = new SkinsRestorerSkinUrlProvider(skinsRestorer);
|
||||
if (core.configuration.getBoolean("skinsrestorer-integration", false)) {
|
||||
SkinsRestorer skinsRestorer = (SkinsRestorer) getServer().getPluginManager().getPlugin("SkinsRestorer");
|
||||
|
||||
if (skinsRestorer == null) {
|
||||
Log.warning("SkinsRestorer integration can't be enabled because SkinsRestorer not installed");
|
||||
} else {
|
||||
skinUrlProvider = new SkinsRestorerSkinUrlProvider(skinsRestorer);
|
||||
Log.info("SkinsRestorer integration enabled");
|
||||
}
|
||||
}
|
||||
|
||||
core.setSkinUrlProvider(skinUrlProvider);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user