Merge pull request #3558 from stepech/SkinsRestorer_update

dependency: Update SkinsRestorer
This commit is contained in:
mikeprimm 2021-12-14 22:22:48 -06:00 committed by GitHub
commit 9a74f7b8bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 14 deletions

View File

@ -5,7 +5,7 @@ repositories {
url 'https://jitpack.io'
}
maven {
url 'https://repo.codemc.org/repository/maven-snapshots'
url 'https://repo.codemc.org/repository/maven-releases/'
}
}
@ -15,7 +15,7 @@ dependencies {
implementation 'me.lucko.luckperms:luckperms-api:4.3'
implementation 'net.luckperms:api:5.0'
implementation('com.github.MilkBowl:VaultAPI:1.7') { transitive = false }
compileOnly 'net.skinsrestorer:skinsrestorer:14.1.0-SNAPSHOT@jar'
compileOnly 'net.skinsrestorer:skinsrestorer-api:14.1.+'
implementation project(":dynmap-api")
implementation project(path: ":DynmapCore", configuration: "shadow")
implementation group: 'ru.tehkode', name: 'PermissionsEx', version: '1.19.1'

View File

@ -110,7 +110,6 @@ import org.dynmap.renderer.DynmapBlockState;
import org.dynmap.utils.MapChunkCache;
import org.dynmap.utils.Polygon;
import org.dynmap.utils.VisibilityLimit;
import net.skinsrestorer.bukkit.SkinsRestorer;
public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
private DynmapCore core;
@ -959,18 +958,24 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
SkinsRestorerSkinUrlProvider skinUrlProvider = null;
if (core.configuration.getBoolean("skinsrestorer-integration", false)) {
try {
SkinsRestorer skinsRestorer = (SkinsRestorer) getServer().getPluginManager().getPlugin("SkinsRestorer");
if (skinsRestorer == null) {
Log.warning("SkinsRestorer integration can't be enabled because SkinsRestorer not installed");
} else {
Plugin skinsRestorer = getServer().getPluginManager().getPlugin("SkinsRestorer");
if (skinsRestorer == null) {
Log.warning("SkinsRestorer integration can't be enabled because SkinsRestorer is not installed");
} else {
try {
skinUrlProvider = new SkinsRestorerSkinUrlProvider();
Log.info("SkinsRestorer API v14 integration enabled");
Log.info("SkinsRestorer API integration enabled");
} catch (NoClassDefFoundError e) {
skinUrlProvider = null;
Log.warning("You are using unsupported version of SkinsRestorer. Use v14.1 or newer.");
Log.warning("Disabled SkinsRestorer integration for this session");
} catch (Throwable e) {
// SkinsRestorer probably updated its API
skinUrlProvider = null;
Log.warning("Error while enabling SkinsRestorer integration", e);
}
} catch(NoClassDefFoundError e) {
Log.warning("You are using unsupported version of SkinsRestorer. Use v14 or newer.");
Log.warning("Disabled SkinsRestorer integration for this session");
}
}

View File

@ -5,8 +5,7 @@ import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.json.simple.JSONObject;
import net.skinsrestorer.api.SkinsRestorerAPI;
import net.skinsrestorer.bukkit.SkinsRestorer;
import net.skinsrestorer.shared.utils.ReflectionUtil;
import net.skinsrestorer.api.reflection.ReflectionUtil;
import java.net.MalformedURLException;
import java.net.URL;