gpt4 book ai didi

java - Bukkit 将玩家皮肤从服务器更改为 png(无效签名)

转载 作者:行者123 更新时间:2023-11-30 06:32:25 26 4
gpt4 key购买 nike

我正在编写一个 bukkit 插件,该插件应该能够向玩家发送 GameProfile 更新以更改玩家的皮肤。但在游戏控制台中,它说皮肤签名无效。如何获得有效的皮肤签名?

/**
* Sets the skin of a player
* @param p The player
* @param fn The file name on the server
*/
public void setSkin(Player p, String fn){
GameProfile gp = ((CraftPlayer)p).getProfile();
String skin = new String(Base64.encodeBase64(("{\"timestamp\":1503497691710,\"profileId\":\"b4be22fdb7004478839c787357d78cbe\",\"profileName\":\"Colinus999\",\"signatureRequired\":false,\"textures\":{\"SKIN\":{\"url\":\"http://colintimbarndt.de/skin/"+fn+"\"}}}").getBytes()));
String sig = "kVWGmfZuMbHc0KhDjX0FrdNA4KK/JTFiSDUQu5O1Jw76/Y+ozfsxZUNkljzCke3cEhpTCdgZuy0nEaBI7WhdunacxBcm7r//a1W/Z5MBJKt3KZM8lySzHlUaM1cSIwRZIrGz5PDcqbgxm/GmOEiewehn6M5vEIBOoYwmCBNpYswVkIG/2qmcHsXUG3zzvzoYdTuKZuBHdGhWHr14TI19deW/Mqru2Bmc+bK1FrGrnT0urUiDIsDbjWXGdOYkci7vMPutlFHDHbFu0+HDalIpeRjI3IiVnwHPim9zu+fkYN92pAyAQeTa2AwmHTMO6/JY/o539HAvYbDcovMzXXZxzPWlozhw3ib+z+OwvsOuBcwPCeN1zhiUYQJFm5lR8d2IvwbNe2y40NWQm0oBI71rneNw2h5TH54muqLRJ297Sli35Ufs0z79I3gn5XTtfiSLFTicZzQ61Nq8CmcXKi4Q/eytHpPkmoNibPsr6BUJd6BI2XDg2YQzdBvpQcjd6azkuQL95arOdlk1UaBMIZwU5/yHaNfiG0Q7+fHTbIXchIHtdr668ly6S0CqOKmvztmcHYlUqV73WBB7GmoZS0tKz8cmMc1hmlvkh+DZ8BQ+EGBu6pYZE6NQ8x+Vv69XIeLUCR3c/JIQ69uGIUwPWa6ainNp//aSUVULsxVS6g3Iwi8=";
gp.getProperties().clear();
gp.getProperties().put("textures", new Property("textures", skin, sig));
gp.getProperties().put("Colinus999", new Property("textures", skin, sig));
// Update the player
for(Player p1 : lobby.getWorld().getPlayers()){
p1.hidePlayer(p);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(Plugin.plugin, new Runnable() {
public void run(){
for(Player p1 : lobby.getWorld().getPlayers()){
p1.showPlayer(p);
}
}
}, 5);
}

我通过打开以下链接获取了签名和其他数据: https://sessionserver.mojang.com/session/minecraft/profile/b4be22fdb7004478839c787357d78cbe?unsigned=false

有关玩家皮肤的更多信息:https://minecraft.gamepedia.com/Player.dat_format#Player_Heads

我知道这是可能的,因为有服务器可以更改玩家的皮肤甚至编辑它。

最佳答案

我修好了它!

我必须保存每个皮肤的 json! (至少签名和皮肤数据)您不需要任何服务器等。

关于java - Bukkit 将玩家皮肤从服务器更改为 png(无效签名),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45843527/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com