Search in sources :

Example 11 with PlayerTexture

use of riskyken.armourersWorkshop.client.texture.PlayerTexture in project Armourers-Workshop by RiskyKen.

the class GuiHelper method drawPlayerHead.

public static void drawPlayerHead(int x, int y, int size, String username) {
    ResourceLocation rl = AbstractClientPlayer.locationStevePng;
    if (!StringUtils.isNullOrEmpty(username)) {
        PlayerTexture playerTexture = getPlayerTexture(username, TextureType.USER);
        rl = playerTexture.getResourceLocation();
    }
    Minecraft.getMinecraft().renderEngine.bindTexture(rl);
    int sourceSize = 8;
    // Face
    Gui.func_152125_a(x + 1, y + 1, 8, 8, sourceSize, sourceSize, size, size, 64, 32);
    // Overlay
    Gui.func_152125_a(x, y, 40, 8, sourceSize, sourceSize, size + 2, size + 2, 64, 32);
}
Also used : PlayerTexture(riskyken.armourersWorkshop.client.texture.PlayerTexture) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 12 with PlayerTexture

use of riskyken.armourersWorkshop.client.texture.PlayerTexture in project Armourers-Workshop by RiskyKen.

the class BlockArmourer method onBlockPlacedBy.

@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
    if (entity instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) entity;
        TileEntity te = world.getTileEntity(x, y, z);
        if (te != null && te instanceof TileEntityArmourer) {
            ForgeDirection direction = BlockUtils.determineDirectionSide(entity).getOpposite();
            ((TileEntityArmourer) te).setDirection(ForgeDirection.NORTH);
            if (!world.isRemote) {
                ((TileEntityArmourer) te).setTexture(new PlayerTexture(player.getCommandSenderName(), TextureType.USER));
                ((TileEntityArmourer) te).onPlaced();
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityArmourer(riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer) PlayerTexture(riskyken.armourersWorkshop.client.texture.PlayerTexture) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Aggregations

PlayerTexture (riskyken.armourersWorkshop.client.texture.PlayerTexture)12 GameProfile (com.mojang.authlib.GameProfile)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 TileEntity (net.minecraft.tileentity.TileEntity)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)2 TileEntityArmourer (riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer)2 Point (java.awt.Point)1 BufferedImage (java.awt.image.BufferedImage)1 Minecraft (net.minecraft.client.Minecraft)1 AbstractClientPlayer (net.minecraft.client.entity.AbstractClientPlayer)1 RenderBlocks (net.minecraft.client.renderer.RenderBlocks)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 World (net.minecraft.world.World)1 ISkinDye (riskyken.armourersWorkshop.api.common.skin.data.ISkinDye)1 ISkinPointer (riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer)1 ISkinPartTypeTextured (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured)1 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)1 GuiMannequin (riskyken.armourersWorkshop.client.gui.mannequin.GuiMannequin)1 GuiMannequinTabSkinHair (riskyken.armourersWorkshop.client.gui.mannequin.GuiMannequinTabSkinHair)1