Search in sources :

Example 1 with ProfileProperty

use of com.destroystokyo.paper.profile.ProfileProperty in project VoxelGamesLibv2 by VoxelGamesLib.

the class TextureListener method doStuff.

public Skin doStuff(PlayerProfile playerProfile) {
    Skin skin = textureHandler.getSkin(118300).orElseThrow(() -> new RuntimeException("d"));
    playerProfile.clearProperties();
    playerProfile.setProperty(new ProfileProperty("textures", skin.data.texture.value, skin.data.texture.signature));
    return skin;
}
Also used : ProfileProperty(com.destroystokyo.paper.profile.ProfileProperty) Skin(org.mineskin.data.Skin)

Example 2 with ProfileProperty

use of com.destroystokyo.paper.profile.ProfileProperty in project VoxelGamesLibv2 by VoxelGamesLib.

the class TextureListener method onLogin.

@EventHandler
public void onLogin(com.destroystokyo.paper.event.profile.PreLookupProfileEvent e) {
    Skin skin = doStuff(Bukkit.createProfile(e.getUUID(), e.getName()));
    e.setProfileProperties(new HashSet<ProfileProperty>() {

        {
            add(new ProfileProperty("textures", skin.data.texture.value, skin.data.texture.signature));
        }
    });
}
Also used : ProfileProperty(com.destroystokyo.paper.profile.ProfileProperty) Skin(org.mineskin.data.Skin) EventHandler(org.bukkit.event.EventHandler)

Example 3 with ProfileProperty

use of com.destroystokyo.paper.profile.ProfileProperty in project VoxelGamesLibv2 by VoxelGamesLib.

the class TextureHandler method getPlayerProfile.

public PlayerProfile getPlayerProfile(Skin skin) {
    PlayerProfile playerProfile = Bukkit.createProfile(skin.data.uuid, skin.name);
    playerProfile.setProperty(new ProfileProperty("textures", skin.data.texture.value, skin.data.texture.signature));
    return playerProfile;
}
Also used : ProfileProperty(com.destroystokyo.paper.profile.ProfileProperty) PlayerProfile(com.destroystokyo.paper.profile.PlayerProfile)

Aggregations

ProfileProperty (com.destroystokyo.paper.profile.ProfileProperty)3 Skin (org.mineskin.data.Skin)2 PlayerProfile (com.destroystokyo.paper.profile.PlayerProfile)1 EventHandler (org.bukkit.event.EventHandler)1