mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 14:13:38 +01:00
Merge pull request #3910 from JOO200/fix/skinsrestorercompile
Don't use reflections to access SkinsRestorer API
This commit is contained in:
commit
6fd70b65fe
@ -5,7 +5,7 @@ import org.json.simple.parser.JSONParser;
|
|||||||
import org.json.simple.parser.ParseException;
|
import org.json.simple.parser.ParseException;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import net.skinsrestorer.api.SkinsRestorerAPI;
|
import net.skinsrestorer.api.SkinsRestorerAPI;
|
||||||
import net.skinsrestorer.api.reflection.ReflectionUtil;
|
import net.skinsrestorer.api.property.IProperty;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -25,19 +25,12 @@ public class SkinsRestorerSkinUrlProvider implements SkinUrlProvider {
|
|||||||
public URL getSkinUrl(String playerName) {
|
public URL getSkinUrl(String playerName) {
|
||||||
String skinName = mSkinsRestorerApi.getSkinName(playerName);
|
String skinName = mSkinsRestorerApi.getSkinName(playerName);
|
||||||
|
|
||||||
Object skinDataProperty = mSkinsRestorerApi.getSkinData(skinName == null ? playerName : skinName);
|
IProperty skinDataProperty = mSkinsRestorerApi.getSkinData(skinName == null ? playerName : skinName);
|
||||||
|
|
||||||
if (skinDataProperty == null)
|
if (skinDataProperty == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
String skinDataPropertyValue;
|
String skinDataPropertyValue = skinDataProperty.getValue();
|
||||||
|
|
||||||
try {
|
|
||||||
skinDataPropertyValue = (String) ReflectionUtil.invokeMethod(skinDataProperty, "getValue");
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] skinDataBytes = Base64.getDecoder().decode(skinDataPropertyValue);
|
byte[] skinDataBytes = Base64.getDecoder().decode(skinDataPropertyValue);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user