本文整理汇总了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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
示例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));
}
示例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();
}
}
示例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);
}
}
示例10: getSkinManager
import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public SkinManager getSkinManager()
{
return this.skinManager;
}
示例11: getSkinManager
import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public SkinManager getSkinManager() {
return this.skinManager;
}
示例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;
}
示例13: DeathMarkerRenderer
import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public DeathMarkerRenderer(final SkinManager skinManager) {
this.skinManager = skinManager;
}
示例14: func_152342_ad
import net.minecraft.client.resources.SkinManager; //导入依赖的package包/类
public SkinManager func_152342_ad()
{
return this.field_152350_aA;
}