Search in sources :

Example 1 with TileEntitySkull

use of net.minecraft.server.v1_11_R1.TileEntitySkull in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_11_R1 method setPlayerProfile.

@Override
public void setPlayerProfile(Skull skull, PlayerProfile playerProfile) {
    GameProfile gameProfile = new GameProfile(playerProfile.getUniqueId(), playerProfile.getName());
    if (playerProfile.hasTexture()) {
        gameProfile.getProperties().put("textures", new Property("textures", playerProfile.getTexture(), playerProfile.getTextureSignature()));
    }
    TileEntitySkull tileEntity = ((CraftSkull) skull).getTileEntity();
    tileEntity.setSkullType(SkullType.PLAYER.ordinal());
    tileEntity.setGameProfile(gameProfile);
    skull.getBlock().getState().update();
}
Also used : GameProfile(com.mojang.authlib.GameProfile) CraftSkull(org.bukkit.craftbukkit.v1_11_R1.block.CraftSkull) TileEntitySkull(net.minecraft.server.v1_11_R1.TileEntitySkull) Property(com.mojang.authlib.properties.Property)

Example 2 with TileEntitySkull

use of net.minecraft.server.v1_11_R1.TileEntitySkull in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_8_R3 method setPlayerProfile.

@Override
public void setPlayerProfile(Skull skull, PlayerProfile playerProfile) {
    GameProfile gameProfile = new GameProfile(playerProfile.getUniqueId(), playerProfile.getName());
    if (playerProfile.hasTexture()) {
        gameProfile.getProperties().put("textures", new Property("textures", playerProfile.getTexture(), playerProfile.getTextureSignature()));
    }
    TileEntitySkull tileEntity = ((CraftSkull) skull).getTileEntity();
    tileEntity.setSkullType(SkullType.PLAYER.ordinal());
    tileEntity.setGameProfile(gameProfile);
    skull.getBlock().getState().update();
}
Also used : GameProfile(com.mojang.authlib.GameProfile) CraftSkull(org.bukkit.craftbukkit.v1_8_R3.block.CraftSkull) TileEntitySkull(net.minecraft.server.v1_8_R3.TileEntitySkull) Property(com.mojang.authlib.properties.Property)

Example 3 with TileEntitySkull

use of net.minecraft.server.v1_11_R1.TileEntitySkull in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_9_R2 method setPlayerProfile.

@Override
public void setPlayerProfile(Skull skull, PlayerProfile playerProfile) {
    GameProfile gameProfile = new GameProfile(playerProfile.getUniqueId(), playerProfile.getName());
    if (playerProfile.hasTexture()) {
        gameProfile.getProperties().put("textures", new Property("textures", playerProfile.getTexture(), playerProfile.getTextureSignature()));
    }
    TileEntitySkull tileEntity = ((CraftSkull) skull).getTileEntity();
    tileEntity.setSkullType(SkullType.PLAYER.ordinal());
    tileEntity.setGameProfile(gameProfile);
    skull.getBlock().getState().update();
}
Also used : GameProfile(com.mojang.authlib.GameProfile) CraftSkull(org.bukkit.craftbukkit.v1_9_R2.block.CraftSkull) TileEntitySkull(net.minecraft.server.v1_9_R2.TileEntitySkull) Property(com.mojang.authlib.properties.Property)

Example 4 with TileEntitySkull

use of net.minecraft.server.v1_11_R1.TileEntitySkull in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_10_R1 method setPlayerProfile.

@Override
public void setPlayerProfile(Skull skull, PlayerProfile playerProfile) {
    GameProfile gameProfile = new GameProfile(playerProfile.getUniqueId(), playerProfile.getName());
    if (playerProfile.hasTexture()) {
        gameProfile.getProperties().put("textures", new Property("textures", playerProfile.getTexture(), playerProfile.getTextureSignature()));
    }
    TileEntitySkull tileEntity = ((CraftSkull) skull).getTileEntity();
    tileEntity.setSkullType(SkullType.PLAYER.ordinal());
    tileEntity.setGameProfile(gameProfile);
    skull.getBlock().getState().update();
}
Also used : GameProfile(com.mojang.authlib.GameProfile) CraftSkull(org.bukkit.craftbukkit.v1_10_R1.block.CraftSkull) TileEntitySkull(net.minecraft.server.v1_10_R1.TileEntitySkull) Property(com.mojang.authlib.properties.Property)

Aggregations

GameProfile (com.mojang.authlib.GameProfile)4 Property (com.mojang.authlib.properties.Property)4 TileEntitySkull (net.minecraft.server.v1_10_R1.TileEntitySkull)1 TileEntitySkull (net.minecraft.server.v1_11_R1.TileEntitySkull)1 TileEntitySkull (net.minecraft.server.v1_8_R3.TileEntitySkull)1 TileEntitySkull (net.minecraft.server.v1_9_R2.TileEntitySkull)1 CraftSkull (org.bukkit.craftbukkit.v1_10_R1.block.CraftSkull)1 CraftSkull (org.bukkit.craftbukkit.v1_11_R1.block.CraftSkull)1 CraftSkull (org.bukkit.craftbukkit.v1_8_R3.block.CraftSkull)1 CraftSkull (org.bukkit.craftbukkit.v1_9_R2.block.CraftSkull)1