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


Java SkinManager类代码示例

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


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

示例1: getSkinResourceLocation

import net.minecraft.client.resources.SkinManager; //导入依赖的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: loadPlayerTextures

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
protected void loadPlayerTextures()
{
    synchronized (this)
    {
        if (!this.playerTexturesLoaded)
        {
            this.playerTexturesLoaded = true;
            Minecraft.getMinecraft().getSkinManager().loadProfileTextures(this.gameProfile, new SkinManager.SkinAvailableCallback()
            {
                public void skinAvailable(Type p_180521_1_, ResourceLocation location, MinecraftProfileTexture profileTexture)
                {
                    switch (p_180521_1_)
                    {
                        case SKIN:
                            NetworkPlayerInfo.this.locationSkin = location;
                            NetworkPlayerInfo.this.skinType = profileTexture.getMetadata("model");

                            if (NetworkPlayerInfo.this.skinType == null)
                            {
                                NetworkPlayerInfo.this.skinType = "default";
                            }

                            break;

                        case CAPE:
                            NetworkPlayerInfo.this.locationCape = location;
                    }
                }
            }, true);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:NetworkPlayerInfo.java

示例3: func_152789_a

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
@Override
public ResourceLocation func_152789_a(final MinecraftProfileTexture texture, final Type type, final SkinManager.SkinAvailableCallback callBack) {
	if (type != Type.SKIN)
		return super.func_152789_a(texture, type, callBack);

	final boolean isSpecialCallBack = callBack instanceof ISkinDownloadCallback;
	final ResourceLocation resLocationOld = new ResourceLocation("skins/" + texture.getHash());
	final ResourceLocation resLocation = new ResourceLocation(Reference.MOD_ID, resLocationOld.getResourcePath());
	ITextureObject itextureobject = textureManager.getTexture(resLocation);

	if (itextureobject != null) {
		if (callBack != null)
			callBack.func_152121_a(type, resLocation);
	} else {
		File file1 = new File(skinFolder, texture.getHash().substring(0, 2));
		File file2 = new File(file1, texture.getHash());
		final NewImageBufferDownload imgDownload = new NewImageBufferDownload();
		ITextureObject imgData = new NewThreadDownloadImageData(file2, texture.getUrl(), field_152793_a, imgDownload, resLocationOld, new IImageBuffer() {

			@Override
			public BufferedImage parseUserSkin(BufferedImage buffImg) {
				if (buffImg != null)
					PlayerModelManager.analyseTexture(buffImg, resLocation);
				return imgDownload.parseUserSkin(buffImg);
			}

			@Override
			public void func_152634_a() {
				imgDownload.func_152634_a();
				if (callBack != null)
					callBack.func_152121_a(type, isSpecialCallBack ? resLocation : resLocationOld);
			}
		});
		textureManager.loadTexture(resLocation, imgData);
		textureManager.loadTexture(resLocationOld, imgData); // Avoid thrown exception if the image is requested before the download is done
	}

	return isSpecialCallBack ? resLocation : resLocationOld;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:40,代码来源:NewSkinManager.java

示例4: loadPlayerTextures

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
protected void loadPlayerTextures()
{
    synchronized (this)
    {
        if (!this.playerTexturesLoaded)
        {
            this.playerTexturesLoaded = true;
            Minecraft.getMinecraft().getSkinManager().loadProfileTextures(this.gameProfile, new SkinManager.SkinAvailableCallback()
            {
                public void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture)
                {
                    switch (typeIn)
                    {
                        case SKIN:
                            NetworkPlayerInfo.this.playerTextures.put(Type.SKIN, location);
                            NetworkPlayerInfo.this.skinType = profileTexture.getMetadata("model");

                            if (NetworkPlayerInfo.this.skinType == null)
                            {
                                NetworkPlayerInfo.this.skinType = "default";
                            }

                            break;

                        case CAPE:
                            NetworkPlayerInfo.this.playerTextures.put(Type.CAPE, location);
                            break;

                        case ELYTRA:
                            NetworkPlayerInfo.this.playerTextures.put(Type.ELYTRA, location);
                    }
                }
            }, true);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:NetworkPlayerInfo.java

示例5: loadPlayerTextures

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
protected void loadPlayerTextures()
{
    synchronized (this)
    {
        if (!this.playerTexturesLoaded)
        {
            this.playerTexturesLoaded = true;
            Minecraft.getMinecraft().getSkinManager().loadProfileTextures(this.gameProfile, new SkinManager.SkinAvailableCallback()
            {
                public void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture)
                {
                    switch (typeIn)
                    {
                        case SKIN:
                            NetworkPlayerInfo.this.playerTextures.put(Type.SKIN, location);
                            NetworkPlayerInfo.this.skinType = profileTexture.getMetadata("model");

                            if (NetworkPlayerInfo.this.skinType == null)
                            {
                                NetworkPlayerInfo.this.skinType = "default";
                            }

                            break;
                        case CAPE:
                            NetworkPlayerInfo.this.playerTextures.put(Type.CAPE, location);
                            break;
                        case ELYTRA:
                            NetworkPlayerInfo.this.playerTextures.put(Type.ELYTRA, location);
                    }
                }
            }, true);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:NetworkPlayerInfo.java

示例6: reloadRemoteSkin

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public void reloadRemoteSkin(SkinManager.SkinAvailableCallback listener) {
    this.remoteSkin = true;
    if (this.remoteSkinTexture != null) {
        this.textureManager.deleteTexture(this.remoteSkinResource);
    }
    if (this.remoteElytraTexture != null) {
        this.textureManager.deleteTexture(this.remoteElytraResource);
    }

    this.remoteSkinTexture = HDSkinManager.getPreviewTexture(this.remoteSkinResource, this.profile, Type.SKIN, NO_SKIN, listener);
    this.remoteElytraTexture = HDSkinManager.getPreviewTexture(this.remoteElytraResource, this.profile, Type.ELYTRA, NO_ELYTRA, null);

}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:14,代码来源:EntityPlayerModel.java

示例7: init

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
@Override
public void init(final FMLInitializationEvent event) {
	super.init(event);

	final SkinManager skinManager = Minecraft.getMinecraft().getSkinManager();

	ClientRegistry.bindTileEntitySpecialRenderer(DeathMarkerTileEntity.class, new DeathMarkerRenderer(skinManager));
}
 
开发者ID:benblank,项目名称:Ice,代码行数:9,代码来源:ClientProxy.java

示例8: run

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
@Override
public void run() {
    try {
        Thread.sleep(1000);
    } catch (InterruptedException e1) {
        e1.printStackTrace();
    }
    running = true;
    String response = null;
    try {
        response = MiscUtils.post(new URL("https://www.wurst-capes.tk/cosmetics/"),
                JsonUtils.gson.toJson(JsonUtils.gson.toJsonTree(callbacks.keySet()).getAsJsonArray()),
                "application/json");
        JsonObject cosmetics = JsonUtils.jsonParser.parse(response).getAsJsonObject();

        for (Entry<String, JsonElement> entry : cosmetics.entrySet()) {
            JsonObject playerCosmetics = entry.getValue().getAsJsonObject();
            Minecraft.getMinecraft().addScheduledTask(() -> {
                SkinManager skinManager = Minecraft.getMinecraft().getSkinManager();
                if (playerCosmetics.has("skin"))

                {
                    skinManager
                            .loadSkin(new MinecraftProfileTexture(playerCosmetics.get("skin").getAsString(), null),
                                    Type.SKIN, callbacks.get(entry.getKey()));
                }
                if (playerCosmetics.has("cape")) {
                    skinManager
                            .loadSkin(new MinecraftProfileTexture(playerCosmetics.get("cape").getAsString(), null),
                                    Type.CAPE, callbacks.get(entry.getKey()));
                }
            });
        }
    } catch (Exception e) {
        System.err.println("[Wurst] Failed to load " + callbacks.size() + " cosmetic(s) from wurst-capes.tk!");
        System.out.println("Server response:\n" + response);
        e.printStackTrace();
    }
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:40,代码来源:CapeFetcher.java

示例9: AbstractClientPlayer

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public AbstractClientPlayer(World p_i45074_1_, GameProfile p_i45074_2_)
{
    super(p_i45074_1_, p_i45074_2_);
    String s = this.getCommandSenderName();

    if (!s.isEmpty())
    {
        SkinManager skinmanager = Minecraft.getMinecraft().func_152342_ad();
        skinmanager.func_152790_a(p_i45074_2_, this, true);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:AbstractClientPlayer.java

示例10: getSkinManager

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public SkinManager getSkinManager()
{
    return this.skinManager;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:Minecraft.java

示例11: getSkinManager

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public SkinManager getSkinManager() {
	return this.skinManager;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:4,代码来源:Minecraft.java

示例12: NewSkinManager

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public NewSkinManager(SkinManager oldManager, TextureManager textureManager, File skinFolder, MinecraftSessionService sessionService) {
	super(textureManager, skinFolder, sessionService);

	this.textureManager = textureManager;
	this.skinFolder = skinFolder;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:7,代码来源:NewSkinManager.java

示例13: DeathMarkerRenderer

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public DeathMarkerRenderer(final SkinManager skinManager) {
	this.skinManager = skinManager;
}
 
开发者ID:benblank,项目名称:Ice,代码行数:4,代码来源:DeathMarkerRenderer.java

示例14: func_152342_ad

import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public SkinManager func_152342_ad()
{
    return this.field_152350_aA;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:Minecraft.java


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