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(); } }
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); } }
/** * 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; }
@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; }
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); }
public ResourceLocation getLocationSkin() { if (this.locationSkin == null) { this.loadPlayerTextures(); } return (ResourceLocation)Objects.firstNonNull(this.locationSkin, DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId())); }
@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()); }
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); } }
@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(); }
/** * 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(); }
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()); } }
/** * 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(); }
public String getSkinType() { NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo(); return networkplayerinfo == null ? DefaultPlayerSkin.getSkinType(this.getUniqueID()) : networkplayerinfo.getSkinType(); }
public String getSkinType() { return this.skinType == null ? DefaultPlayerSkin.getSkinType(this.gameProfile.getId()) : this.skinType; }
public ResourceLocation getLocationSkin() { this.loadPlayerTextures(); return (ResourceLocation)Objects.firstNonNull(this.playerTextures.get(Type.SKIN), DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId())); }