Solved Get Value and Signature from Skin

Discussion in 'Spigot Plugin Development' started by David_Mayr, Apr 1, 2020.

  1. How can I get the Skin Value and Signature from a Player?
    I want to cache it on PlayerJoinEvent in Redis for 10 days to keep the Mojang requests low
    How can I get the value and Signature
     
  2. bump. I need it quickly
     
  3. But how do i get it WIGHOUT mojang requests? The Player has it in the Gameprofile right? So how can I get it out of there?
     
  4. Afaik you can not get it out of the game profile is the server is in offline mode...
    Best way is still to request it from the api using ?unsigned=false
     
  5. And with bungeecord? I know that the player has the skin somewhere in his gameprofile. But where?

    Is it that hard to read?
     
  6. Got it!

    Code (Text):

    GameProfile profile = ((CraftPlayer) event.getPlayer()).getHandle().getProfile();
    Property property = profile.getProperties().get("textures").stream().findFirst().orElse(null);
    if(property != null) {
        System.out.println(property.getName());
        System.out.println(property.getSignature());
        System.out.println(property.getValue());
    }
     
    output:
    Code (Text):

    [21:10:46 INFO]: textures
    [21:10:46 INFO]: CAKKyHIE17J5LNNEKgwGm5ncUvnrtsvTQspOrj5p1gBdJaICLoEk59ouhwtANL37e5Bw0uQgow2sjhoHeJN9AaDhOmQu0vkLLSUneFtylZ2jGxr3V7YbOe1FFQWafXz0Y194/EXHBYZNDH1yeMbX1PG33+IIKNhuzJBDbSgsVvOoxmvHLA6gHmu8HWV5H6BGTQrAN7Vj2UbqeCPgySqDrWl04ZNSu4qvchrrE3HuJSBGBETrklWsA64ucISLr05u2txfFKlII4gKPRQwjXU5z/WVAX3mqRgIYsbz03PYIcg8XoBFfNkmC/FI4AosindiRFSoyKAQuu8VbkUaax44udaRHCTGJ0WtLUG/ycPfrRf8oUAlB0scrYIR/RCqS2RcGhNVTU8l5WGiQVX5pEF0jMK1P1FO+M6fvxClKqIMEBTfQ8VsMCaEgAy+fQoIkOporI8hZhu9i07ntntwQlDunCov216Vyf7+12K2mDuTzKnklio0zoCiSyXEpRMzYPyGrPdGAgkpYGFVYjCuirw/l38IA9207tY/vc2ER8KyV/Kfa1uM9fTyTy2gLOYQRG5ZezDV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