1.12.5
This commit is contained in:
parent
5572a0eed3
commit
76e89a4052
2 changed files with 49 additions and 27 deletions
|
|
@ -93,6 +93,28 @@ public class ItemUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
SkullMeta skullMeta = (SkullMeta) item.getItemMeta();
|
SkullMeta skullMeta = (SkullMeta) item.getItemMeta();
|
||||||
|
ServerVersion serverVersion = PlayerKits2.serverVersion;
|
||||||
|
if(serverVersion.serverVersionGreaterEqualThan(serverVersion,ServerVersion.v1_21_R1)){
|
||||||
|
PlayerProfile profile = skullMeta.getOwnerProfile();
|
||||||
|
if(profile != null){
|
||||||
|
owner = profile.getName();
|
||||||
|
if(profile.getUniqueId() != null){
|
||||||
|
id = profile.getUniqueId().toString();
|
||||||
|
}
|
||||||
|
if(profile.getTextures() != null){
|
||||||
|
PlayerTextures textures = profile.getTextures();
|
||||||
|
if(textures != null){
|
||||||
|
JsonObject skinJsonObject = new JsonObject();
|
||||||
|
skinJsonObject.addProperty("url", textures.getSkin().toString());
|
||||||
|
JsonObject texturesJsonObject = new JsonObject();
|
||||||
|
texturesJsonObject.add("SKIN", skinJsonObject);
|
||||||
|
JsonObject minecraftTexturesJsonObject = new JsonObject();
|
||||||
|
minecraftTexturesJsonObject.add("textures", texturesJsonObject);
|
||||||
|
texture = new String(Base64.getEncoder().encode(minecraftTexturesJsonObject.toString().getBytes()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
Field profileField;
|
Field profileField;
|
||||||
try {
|
try {
|
||||||
profileField = skullMeta.getClass().getDeclaredField("profile");
|
profileField = skullMeta.getClass().getDeclaredField("profile");
|
||||||
|
|
@ -106,7 +128,6 @@ public class ItemUtils {
|
||||||
id = gameProfile.getId().toString();
|
id = gameProfile.getId().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerVersion serverVersion = PlayerKits2.serverVersion;
|
|
||||||
for(Property p : propertyMap.values()) {
|
for(Property p : propertyMap.values()) {
|
||||||
if(serverVersion.serverVersionGreaterEqualThan(serverVersion,ServerVersion.v1_20_R2)){
|
if(serverVersion.serverVersionGreaterEqualThan(serverVersion,ServerVersion.v1_20_R2)){
|
||||||
String pName = (String)p.getClass().getMethod("name").invoke(p);
|
String pName = (String)p.getClass().getMethod("name").invoke(p);
|
||||||
|
|
@ -124,6 +145,7 @@ public class ItemUtils {
|
||||||
| InvocationTargetException | NoSuchMethodException e) {
|
| InvocationTargetException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(texture != null || id != null || owner != null) {
|
if(texture != null || id != null || owner != null) {
|
||||||
kitItemSkullData = new KitItemSkullData(owner,texture,id);
|
kitItemSkullData = new KitItemSkullData(owner,texture,id);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
main: pk.ajneb97.PlayerKits2
|
main: pk.ajneb97.PlayerKits2
|
||||||
version: 1.12.4
|
version: 1.12.5
|
||||||
name: PlayerKits2
|
name: PlayerKits2
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend: [Vault,PlaceholderAPI]
|
softdepend: [Vault,PlaceholderAPI]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue