当前位置: 首页>>代码示例>>Java>>正文


Java DefaultPlayerSkin类代码示例

本文整理汇总了Java中net.minecraft.client.resources.DefaultPlayerSkin的典型用法代码示例。如果您正苦于以下问题:Java DefaultPlayerSkin类的具体用法?Java DefaultPlayerSkin怎么用?Java DefaultPlayerSkin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DefaultPlayerSkin类属于net.minecraft.client.resources包,在下文中一共展示了DefaultPlayerSkin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSkinResourceLocation

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public ResourceLocation getSkinResourceLocation() {
	if (owner != null) {
		final SkinManager manager = Minecraft.getMinecraft().getSkinManager();
		Map<Type, MinecraftProfileTexture> map = manager.loadSkinFromCache(owner);

		if (map.containsKey(Type.SKIN)) {
			final MinecraftProfileTexture skin = map.get(Type.SKIN);
			return manager.loadSkin(skin, Type.SKIN);
		} else {
			UUID uuid = EntityPlayer.getUUID(owner);
			return DefaultPlayerSkin.getDefaultSkin(uuid);
		}
	}

	return null;
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:18,代码来源:EntityMiniMe.java

示例2: TeamSelectionObject

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public TeamSelectionObject(ScorePlayerTeam p_i45492_2_)
{
    this.field_178676_b = p_i45492_2_;
    this.field_178675_d = Lists.<NetworkPlayerInfo>newArrayList();

    for (String s : p_i45492_2_.getMembershipCollection())
    {
        NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(s);

        if (networkplayerinfo != null)
        {
            this.field_178675_d.add(networkplayerinfo);
        }
    }

    if (!this.field_178675_d.isEmpty())
    {
        String s1 = ((NetworkPlayerInfo)this.field_178675_d.get((new Random()).nextInt(this.field_178675_d.size()))).getGameProfile().getName();
        this.field_178677_c = AbstractClientPlayer.getLocationSkin(s1);
        AbstractClientPlayer.getDownloadImageSkin(this.field_178677_c, s1);
    }
    else
    {
        this.field_178677_c = DefaultPlayerSkin.getDefaultSkinLegacy();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:TeleportToTeam.java

示例3: TeamSelectionObject

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public TeamSelectionObject(ScorePlayerTeam p_i45492_2_)
{
    this.team = p_i45492_2_;
    this.players = Lists.<NetworkPlayerInfo>newArrayList();

    for (String s : p_i45492_2_.getMembershipCollection())
    {
        NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getConnection().getPlayerInfo(s);

        if (networkplayerinfo != null)
        {
            this.players.add(networkplayerinfo);
        }
    }

    if (this.players.isEmpty())
    {
        this.location = DefaultPlayerSkin.getDefaultSkinLegacy();
    }
    else
    {
        String s1 = ((NetworkPlayerInfo)this.players.get((new Random()).nextInt(this.players.size()))).getGameProfile().getName();
        this.location = AbstractClientPlayer.getLocationSkin(s1);
        AbstractClientPlayer.getDownloadImageSkin(this.location, s1);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:TeleportToTeam.java

示例4: getLocationSkin

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
/**
 * Get this player's skin 
 */
@Override
public ResourceLocation getLocationSkin()
{
    ResourceLocation resourcelocation = DefaultPlayerSkin.getDefaultSkinLegacy();

    if (profile != null)
    {
        Minecraft minecraft = Minecraft.getMinecraft();
        Map<Type, MinecraftProfileTexture> map = minecraft.getSkinManager().loadSkinFromCache(profile);

        if (map.containsKey(Type.SKIN))
        {
            resourcelocation = minecraft.getSkinManager().loadSkin((MinecraftProfileTexture) map.get(Type.SKIN), Type.SKIN);
        }
        else
        {
            UUID uuid = EntityPlayer.getUUID(profile);
            resourcelocation = DefaultPlayerSkin.getDefaultSkin(uuid);
        }
    }

    return resourcelocation;
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:27,代码来源:PlayerMorph.java

示例5: bindFace

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public static void bindFace(String p_bindFace_0_, String p_bindFace_1_)
{
    ResourceLocation resourcelocation = AbstractClientPlayer.getLocationSkin(p_bindFace_1_);

    if (resourcelocation == null)
    {
        resourcelocation = DefaultPlayerSkin.getDefaultSkin(UUIDTypeAdapter.fromString(p_bindFace_0_));
    }

    AbstractClientPlayer.getDownloadImageSkin(resourcelocation, p_bindFace_1_);
    Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:RealmsScreen.java

示例6: getLocationSkin

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public ResourceLocation getLocationSkin()
{
    if (this.locationSkin == null)
    {
        this.loadPlayerTextures();
    }

    return (ResourceLocation)Objects.firstNonNull(this.locationSkin, DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId()));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:NetworkPlayerInfo.java

示例7: getEntityTexture

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
@Override
public ResourceLocation getEntityTexture(final AbstractClientPlayer entity) {

	return entity.getCapability(TF2weapons.WEAPONS_CAP, null).skinDisguise != null
			? entity.getCapability(TF2weapons.WEAPONS_CAP, null).skinDisguise
			: DefaultPlayerSkin.getDefaultSkin(entity.getUniqueID());
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:8,代码来源:RenderPlayerDisguised.java

示例8: loadTexture

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
private void loadTexture(GameProfile profile, final Type type, final SkinAvailableCallback callback) {
    if (profile.getId() != null) {
        Map<Type, MinecraftProfileTexture> data = getProfileData(profile);
        final MinecraftProfileTexture texture = data.get(type);

        String skinDir = type.toString().toLowerCase() + "s/";
        final ResourceLocation skin = new ResourceLocation("hdskins", skinDir + texture.getHash());
        File file2 = new File(LiteLoader.getAssetsDirectory(), "hd/" + skinDir + texture.getHash().substring(0, 2) + "/" + texture.getHash());

        final IImageBuffer imagebufferdownload = type == Type.SKIN ? new ImageBufferDownloadHD() : null;

        ITextureObject texObject = new ThreadDownloadImageETag(file2, texture.getUrl(),
                DefaultPlayerSkin.getDefaultSkinLegacy(),
                new IImageBuffer() {
                    @Nonnull
                    @Override
                    public BufferedImage parseUserSkin(@Nonnull BufferedImage image) {
                        BufferedImage image1 = image;
                        if (imagebufferdownload != null) {
                            image1 = imagebufferdownload.parseUserSkin(image);
                        }
                        return image1 == null ? image : image1;
                    }

                    @Override
                    public void skinAvailable() {
                        if (imagebufferdownload != null) {
                            imagebufferdownload.skinAvailable();
                        }
                        callback.skinAvailable(type, skin, texture);
                    }
                });

        // schedule texture loading on the main thread.
        TextureLoader.loadTexture(skin, texObject);
    }
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:38,代码来源:HDSkinManager.java

示例9: renderTileEntityAt

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
@Override
public void renderTileEntityAt(final DeathMarkerTileEntity ice, final double x, final double y, final double z, final float partialTicks, final int destroyStage) {
	ResourceLocation texture = DefaultPlayerSkin.getDefaultSkin(new UUID(0, 0));

	final GameProfile owner = ice.getOwner();

	if (owner == null) {
		Ice.getProxy().getLogger().warn("Rendering death marker with no owner at %d,%d,%d!", x, y, z);
	} else {
		final Map<Type, MinecraftProfileTexture> profileTextures = this.skinManager.loadSkinFromCache(owner);

		if (profileTextures.containsKey(Type.SKIN)) {
			texture = this.skinManager.loadSkin(profileTextures.get(Type.SKIN), Type.SKIN);
		} else {
			texture = DefaultPlayerSkin.getDefaultSkin(owner.getId());
		}
	}

	this.bindTexture(texture);

	GL11.glPushMatrix();

	final float age = ice.getAge() + partialTicks;
	final double bobHeight = 0.5 + Math.sin(age * Math.PI / 50) / 4;

	GL11.glDisable(GL11.GL_CULL_FACE);
	GL11.glTranslated(x + 0.5, y + bobHeight, z + 0.5);
	GL11.glEnable(GL12.GL_RESCALE_NORMAL);
	GL11.glScaled(-1, -1, 1);
	GL11.glEnable(GL11.GL_ALPHA_TEST);
	this.model.render(null, 0, 0, 0, 3 * age, 0, 0.0625f);

	GL11.glPopMatrix();
}
 
开发者ID:benblank,项目名称:Ice,代码行数:35,代码来源:DeathMarkerRenderer.java

示例10: getEntityTexture

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 *
 * @param entity The entity to be rendered
 */
@Override
protected ResourceLocation getEntityTexture(EntityLootableBody entity) {
	if(LootableBodies.useLocalSkin) return localSkin;

	GameProfile profile = entity.getGameProfile();
	if (profile != null && profile.getId() != null) {
		return getSkin(profile);
	}

	return DefaultPlayerSkin.getDefaultSkinLegacy();
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:LootableBodies,代码行数:17,代码来源:CorpseRenderer.java

示例11: getSkin

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public static ResourceLocation getSkin(GameProfile profile) {
	final Minecraft minecraft = Minecraft.getMinecraft();
	final Map loadSkinFromCache = minecraft.getSkinManager().loadSkinFromCache(profile); // returned map may or may not be typed
	if (loadSkinFromCache.containsKey(MinecraftProfileTexture.Type.SKIN)) {
		ResourceLocation skin = minecraft.getSkinManager().loadSkin((MinecraftProfileTexture) loadSkinFromCache.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN);
		return skin;
	} else {
		return DefaultPlayerSkin.getDefaultSkin(profile.getId());
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:LootableBodies,代码行数:11,代码来源:CorpseRenderer.java

示例12: getLocationSkin

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
/**
 * Returns true if the player instance has an associated skin.
 */
public ResourceLocation getLocationSkin()
{
    NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
    return networkplayerinfo == null ? DefaultPlayerSkin.getDefaultSkin(this.getUniqueID()) : networkplayerinfo.getLocationSkin();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:AbstractClientPlayer.java

示例13: getSkinType

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public String getSkinType()
{
    NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
    return networkplayerinfo == null ? DefaultPlayerSkin.getSkinType(this.getUniqueID()) : networkplayerinfo.getSkinType();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:AbstractClientPlayer.java

示例14: getSkinType

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
public String getSkinType()
{
    return this.skinType == null ? DefaultPlayerSkin.getSkinType(this.gameProfile.getId()) : this.skinType;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:NetworkPlayerInfo.java

示例15: getLocationSkin

import net.minecraft.client.resources.DefaultPlayerSkin; //导入依赖的package包/类
/**
 * Returns true if the player instance has an associated skin.
 */
public ResourceLocation getLocationSkin() {
  NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
  return networkplayerinfo == null ? DefaultPlayerSkin.getDefaultSkin(this.getUniqueID()) : networkplayerinfo.getLocationSkin();
}
 
开发者ID:halfpetal,项目名称:CapesAPI-ClientImplementation,代码行数:8,代码来源:AbstractClientPlayer.java


注:本文中的net.minecraft.client.resources.DefaultPlayerSkin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。