mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-01-05 23:37:34 +01:00
feat!: support creating a wrapped GameProfile with textureSignature
This commit is contained in:
parent
2f2979c6aa
commit
f3d230cc90
@ -13,16 +13,16 @@ public interface NMSPlayer {
|
||||
|
||||
GameProfile getProfile(Player p);
|
||||
|
||||
GameProfile createProfile(UUID id, String name, @Nullable String textureValue);
|
||||
GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature);
|
||||
|
||||
default GameProfile createProfileByUrl(String url) {
|
||||
UUID id = UUID.nameUUIDFromBytes(("SongodaCore:" + url).getBytes(StandardCharsets.UTF_8));
|
||||
String rawTextureValue = "{\"textures\":{\"SKIN\":{\"url\":\"" + url + "\"}}}";
|
||||
return createProfile(id, "by_SongodaCore", Base64.getEncoder().encodeToString(rawTextureValue.getBytes()));
|
||||
return createProfile(id, "by_SongodaCore", Base64.getEncoder().encodeToString(rawTextureValue.getBytes()), null);
|
||||
}
|
||||
|
||||
default GameProfile createProfileByTextureValue(String textureValue) {
|
||||
UUID id = UUID.nameUUIDFromBytes(("SongodaCore:" + textureValue).getBytes(StandardCharsets.UTF_8));
|
||||
return createProfile(id, "by_SongodaCore", textureValue);
|
||||
return createProfile(id, "by_SongodaCore", textureValue, null);
|
||||
}
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -24,10 +24,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -24,10 +24,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
@ -23,10 +23,10 @@ public class NMSPlayerImpl implements NMSPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue) {
|
||||
public GameProfile createProfile(UUID id, String name, @Nullable String textureValue, @Nullable String textureSignature) {
|
||||
com.mojang.authlib.GameProfile profile = new com.mojang.authlib.GameProfile(id, name);
|
||||
if (textureValue != null) {
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue));
|
||||
profile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
|
||||
}
|
||||
|
||||
return wrapProfile(profile);
|
||||
|
Loading…
Reference in New Issue
Block a user