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


Java MinecraftProfileTexture.Type方法代码示例

本文整理汇总了Java中com.mojang.authlib.minecraft.MinecraftProfileTexture.Type方法的典型用法代码示例。如果您正苦于以下问题:Java MinecraftProfileTexture.Type方法的具体用法?Java MinecraftProfileTexture.Type怎么用?Java MinecraftProfileTexture.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mojang.authlib.minecraft.MinecraftProfileTexture的用法示例。


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

示例1: onRenderPlayer

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@SubscribeEvent
public static void onRenderPlayer(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    String uuid = player.getUUID(player.getGameProfile()).toString();
    if(player instanceof AbstractClientPlayer && UUIDS.contains(uuid) && !done.contains(player))
    {
        AbstractClientPlayer clplayer = (AbstractClientPlayer) player;
        if(clplayer.hasPlayerInfo())
        {
            NetworkPlayerInfo info = ReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clplayer, ObfuscatedNames.PLAYER_INFO);
            Map<MinecraftProfileTexture.Type, ResourceLocation> textures = ReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, info, ObfuscatedNames.PLAYER_TEXTURES);
            ResourceLocation loc = new ResourceLocation("proxyslib", "textures/whoknows/special_cape.png");
            textures.put(MinecraftProfileTexture.Type.CAPE, loc);
            textures.put(MinecraftProfileTexture.Type.ELYTRA, loc);
            done.add(player);
        }
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:20,代码来源:SpecialPeopleCapeHandler.java

示例2: onRenderPlayer

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@SubscribeEvent
public static void onRenderPlayer(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    String uuid = player.getUUID(player.getGameProfile()).toString();
    if(player instanceof AbstractClientPlayer && UUIDS.contains(uuid) && !done.contains(player))
    {
        AbstractClientPlayer clplayer = (AbstractClientPlayer) player;
        if(clplayer.hasPlayerInfo())
        {
            NetworkPlayerInfo info = ReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clplayer, ObfuscatedNames.PLAYER_INFO);
            Map<MinecraftProfileTexture.Type, ResourceLocation> textures = ReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, info, ObfuscatedNames.PLAYER_TEXTURES);
            ResourceLocation loc = new ResourceLocation("proxyslib", "textures/whoknows/dev_cape.png");
            textures.put(MinecraftProfileTexture.Type.CAPE, loc);
            textures.put(MinecraftProfileTexture.Type.ELYTRA, loc);
            done.add(player);
        }
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:20,代码来源:NekoCapeHandler.java

示例3: PlayerSkin

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
public PlayerSkin(UUID uuid){
	profile = new GameProfile(uuid, ProfileUtil.getUsername(uuid));
	PropertyMap properties = ProfileUtil.getProperties(uuid);
	if(properties !=null){
		Property textureProperty = Iterables.getFirst(properties.get("textures"), null);
		Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = null;
		MinecraftTexturesPayload result;
        try {
            String json = new String(Base64.decodeBase64(textureProperty.getValue()), Charsets.UTF_8);
            result = gson.fromJson(json, MinecraftTexturesPayload.class);
            map = result.getTextures();
        } catch (JsonParseException e) {
            ModLogger.error("Could not decode textures payload", e);
            map = new HashMap<MinecraftProfileTexture.Type, MinecraftProfileTexture>();
        }
        for(Type type : map.keySet()){
        	Minecraft.getMinecraft().getSkinManager().loadSkin(map.get(type), type, this);
        }
	}
	
	//playerTextures = downloadPlayerTextures(profile);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:23,代码来源:DownloadedTextures.java

示例4: getPlayerTexture

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
public static ResourceLocation getPlayerTexture(GameProfile playerProfile) {
    ResourceLocation texture = Resources.STEVE;
    if (playerProfile != null) {
        if (playersTextureMap.containsKey(playerProfile)) {
            texture = playersTextureMap.get(playerProfile);
        } else {
            Minecraft minecraft = Minecraft.getMinecraft();
            Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = minecraft.getSkinManager().loadSkinFromCache(playerProfile);

            if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) {
                texture = minecraft.getSkinManager().loadSkin(map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN);
                playersTextureMap.put(playerProfile, texture);
            } else {
                minecraft.getSkinManager().loadProfileTextures(playerProfile, (type, texture1, profileTexture) -> playersTextureMap.put(playerProfile, texture1), true);
            }
        }
    }

    return texture;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:21,代码来源:GameProfileHelper.java

示例5: onSetLocalSkin

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
protected void onSetLocalSkin(MinecraftProfileTexture.Type type) {
    MineLittlePony.logger.debug("Invalidating old local skin, checking updated local skin");
    if (type == MinecraftProfileTexture.Type.SKIN) {
        ponyManager.removePony(this.localPlayer.getSkinTexture());
    }
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:8,代码来源:GuiSkinsMineLP.java

示例6: onSetRemoteSkin

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
protected void onSetRemoteSkin(MinecraftProfileTexture.Type type, ResourceLocation location, MinecraftProfileTexture profileTexture) {
    MineLittlePony.logger.debug("Invalidating old remote skin, checking updated remote skin");
    if (type == MinecraftProfileTexture.Type.SKIN) {
        ponyManager.removePony(location);
    }
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:8,代码来源:GuiSkinsMineLP.java

示例7: loadProfileData

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
public Optional<MinecraftTexturesPayload> loadProfileData(GameProfile profile) {
    ImmutableMap.Builder<MinecraftProfileTexture.Type, MinecraftProfileTexture> builder = ImmutableMap.builder();
    for (MinecraftProfileTexture.Type type : MinecraftProfileTexture.Type.values()) {

        String url = getPath(this.address, type, profile);
        try {
            HttpURLConnection urlConnection = (HttpURLConnection) new URL(url).openConnection();
            if (urlConnection.getResponseCode() / 100 != 2) {
                throw new IOException("Bad response code: " + urlConnection.getResponseCode());
            }
            builder.put(type, new MinecraftProfileTexture(url, null));
            logger.debug("Found skin for {} at {}", profile.getName(), url);
        } catch (IOException e) {
            logger.trace("Couldn't find texture for {} at {}. Does it exist?", profile.getName(), url, e);
        }
    }

    Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = builder.build();
    if (map.isEmpty()) {
        logger.debug("No textures found for {} at {}", profile, this.address);
        return Optional.empty();
    }

    return Optional.of(new TexturesPayloadBuilder()
            .profileId(profile.getId())
            .profileName(profile.getName())
            .timestamp(System.currentTimeMillis())
            .isPublic(true)
            .textures(map)
            .build());
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:33,代码来源:LegacySkinServer.java

示例8: uploadSkin

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
public ListenableFuture<SkinUploadResponse> uploadSkin(Session session, @Nullable Path image, MinecraftProfileTexture.Type type) {

    if (Strings.isNullOrEmpty(this.gateway))
        return Futures.immediateFailedFuture(new NullPointerException("gateway url is blank"));

    return HDSkinManager.skinUploadExecutor.submit(() -> {
        verifyServerConnection(session, SERVER_ID);

        Map<String, ?> data = image == null ? getClearData(session, type) : getUploadData(session, type, image);
        ThreadMultipartPostUpload upload = new ThreadMultipartPostUpload(this.gateway, data);
        String response = upload.uploadMultipart();
        return new SkinUploadResponse(response.equalsIgnoreCase("OK"), response);
    });
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:16,代码来源:LegacySkinServer.java

示例9: getData

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
private static Map<String, ?> getData(Session session, MinecraftProfileTexture.Type type, String param, Object val) {
    return ImmutableMap.of(
            "user", session.getUsername(),
            "uuid", session.getPlayerID(),
            "type", type.toString().toLowerCase(Locale.US),
            param, val);
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:8,代码来源:LegacySkinServer.java

示例10: getPreviewTexture

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
public Optional<MinecraftProfileTexture> getPreviewTexture(MinecraftProfileTexture.Type type, GameProfile profile) {
    if (Strings.isNullOrEmpty(this.gateway))
        return Optional.empty();
    return Optional.of(new MinecraftProfileTexture(getPath(this.gateway, type, profile), null));
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:7,代码来源:LegacySkinServer.java

示例11: getClearData

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
private static Map<String, ?> getClearData(Session session, MinecraftProfileTexture.Type type) {
    return getData(session, type, "clear", "1");
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:4,代码来源:LegacySkinServer.java

示例12: getUploadData

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
private static Map<String, ?> getUploadData(Session session, MinecraftProfileTexture.Type type, Path skinFile) {
    return getData(session, type, type.toString().toLowerCase(Locale.US), skinFile);
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:4,代码来源:LegacySkinServer.java

示例13: getPath

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
private static String getPath(String address, MinecraftProfileTexture.Type type, GameProfile profile) {
    String uuid = UUIDTypeAdapter.fromUUID(profile.getId());
    String path = type.toString().toLowerCase() + "s";
    return String.format("%s/%s/%s.png", address, path, uuid);
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:6,代码来源:LegacySkinServer.java

示例14: getPreviewTexture

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
public Optional<MinecraftProfileTexture> getPreviewTexture(MinecraftProfileTexture.Type type, GameProfile profile) {
    return null;
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:5,代码来源:ValhallaSkinServer.java

示例15: uploadSkin

import com.mojang.authlib.minecraft.MinecraftProfileTexture; //导入方法依赖的package包/类
@Override
public ListenableFuture<SkinUploadResponse> uploadSkin(Session session, @Nullable Path image, MinecraftProfileTexture.Type type) {
    return null;
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:5,代码来源:ValhallaSkinServer.java


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