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);
}
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();
}
}
}
}
Aggregations