Java 类net.minecraft.client.renderer.texture.LayeredColorMaskTexture 实例源码

项目:Backmemed    文件:BannerTextures.java   
@Nullable
public ResourceLocation getResourceLocation(String id, List<BannerPattern> patternList, List<EnumDyeColor> colorList)
{
    if (id.isEmpty())
    {
        return null;
    }
    else
    {
        id = this.cacheId + id;
        BannerTextures.CacheEntry bannertextures$cacheentry = (BannerTextures.CacheEntry)this.cacheMap.get(id);

        if (bannertextures$cacheentry == null)
        {
            if (this.cacheMap.size() >= 256 && !this.freeCacheSlot())
            {
                return BannerTextures.BANNER_BASE_TEXTURE;
            }

            List<String> list = Lists.<String>newArrayList();

            for (BannerPattern bannerpattern : patternList)
            {
                list.add(this.cacheResourceBase + bannerpattern.func_190997_a() + ".png");
            }

            bannertextures$cacheentry = new BannerTextures.CacheEntry();
            bannertextures$cacheentry.textureLocation = new ResourceLocation(id);
            Minecraft.getMinecraft().getTextureManager().loadTexture(bannertextures$cacheentry.textureLocation, new LayeredColorMaskTexture(this.cacheResourceLocation, list, colorList));
            this.cacheMap.put(id, bannertextures$cacheentry);
        }

        bannertextures$cacheentry.lastUseMillis = System.currentTimeMillis();
        return bannertextures$cacheentry.textureLocation;
    }
}
项目:CustomWorldGen    文件:BannerTextures.java   
@Nullable
public ResourceLocation getResourceLocation(String id, List<TileEntityBanner.EnumBannerPattern> patternList, List<EnumDyeColor> colorList)
{
    if (id.isEmpty())
    {
        return null;
    }
    else
    {
        id = this.cacheId + id;
        BannerTextures.CacheEntry bannertextures$cacheentry = (BannerTextures.CacheEntry)this.cacheMap.get(id);

        if (bannertextures$cacheentry == null)
        {
            if (this.cacheMap.size() >= 256 && !this.freeCacheSlot())
            {
                return BannerTextures.BANNER_BASE_TEXTURE;
            }

            List<String> list = Lists.<String>newArrayList();

            for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : patternList)
            {
                list.add(this.cacheResourceBase + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
            }

            bannertextures$cacheentry = new BannerTextures.CacheEntry();
            bannertextures$cacheentry.textureLocation = new ResourceLocation(id);
            Minecraft.getMinecraft().getTextureManager().loadTexture(bannertextures$cacheentry.textureLocation, new LayeredColorMaskTexture(this.cacheResourceLocation, list, colorList));
            this.cacheMap.put(id, bannertextures$cacheentry);
        }

        bannertextures$cacheentry.lastUseMillis = System.currentTimeMillis();
        return bannertextures$cacheentry.textureLocation;
    }
}
项目:ExpandedRailsMod    文件:BannerTextures.java   
@Nullable
public ResourceLocation getResourceLocation(String p_187478_1_, List<TileEntityBanner.EnumBannerPattern> p_187478_2_, List<EnumDyeColor> p_187478_3_)
{
    if (p_187478_1_.isEmpty())
    {
        return null;
    }
    else
    {
        p_187478_1_ = this.cacheId + p_187478_1_;
        BannerTextures.CacheEntry bannertextures$cacheentry = (BannerTextures.CacheEntry)this.cacheMap.get(p_187478_1_);

        if (bannertextures$cacheentry == null)
        {
            if (this.cacheMap.size() >= 256 && !this.freeCacheSlot())
            {
                return BannerTextures.BANNER_BASE_TEXTURE;
            }

            List<String> list = Lists.<String>newArrayList();

            for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : p_187478_2_)
            {
                list.add(this.cacheResourceBase + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
            }

            bannertextures$cacheentry = new BannerTextures.CacheEntry();
            bannertextures$cacheentry.textureLocation = new ResourceLocation(p_187478_1_);
            Minecraft.getMinecraft().getTextureManager().loadTexture(bannertextures$cacheentry.textureLocation, new LayeredColorMaskTexture(this.cacheResourceLocation, list, p_187478_3_));
            this.cacheMap.put(p_187478_1_, bannertextures$cacheentry);
        }

        bannertextures$cacheentry.lastUseMillis = System.currentTimeMillis();
        return bannertextures$cacheentry.textureLocation;
    }
}
项目:DecompiledMinecraft    文件:TileEntityBannerRenderer.java   
private ResourceLocation func_178463_a(TileEntityBanner bannerObj)
{
    String s = bannerObj.func_175116_e();

    if (s.isEmpty())
    {
        return null;
    }
    else
    {
        TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s);

        if (tileentitybannerrenderer$timedbannertexture == null)
        {
            if (DESIGNS.size() >= 256)
            {
                long i = System.currentTimeMillis();
                Iterator<String> iterator = DESIGNS.keySet().iterator();

                while (iterator.hasNext())
                {
                    String s1 = (String)iterator.next();
                    TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture1 = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s1);

                    if (i - tileentitybannerrenderer$timedbannertexture1.systemTime > 60000L)
                    {
                        Minecraft.getMinecraft().getTextureManager().deleteTexture(tileentitybannerrenderer$timedbannertexture1.bannerTexture);
                        iterator.remove();
                    }
                }

                if (DESIGNS.size() >= 256)
                {
                    return null;
                }
            }

            List<TileEntityBanner.EnumBannerPattern> list1 = bannerObj.getPatternList();
            List<EnumDyeColor> list = bannerObj.getColorList();
            List<String> list2 = Lists.<String>newArrayList();

            for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : list1)
            {
                list2.add("textures/entity/banner/" + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
            }

            tileentitybannerrenderer$timedbannertexture = new TileEntityBannerRenderer.TimedBannerTexture();
            tileentitybannerrenderer$timedbannertexture.bannerTexture = new ResourceLocation(s);
            Minecraft.getMinecraft().getTextureManager().loadTexture(tileentitybannerrenderer$timedbannertexture.bannerTexture, new LayeredColorMaskTexture(BANNERTEXTURES, list2, list));
            DESIGNS.put(s, tileentitybannerrenderer$timedbannertexture);
        }

        tileentitybannerrenderer$timedbannertexture.systemTime = System.currentTimeMillis();
        return tileentitybannerrenderer$timedbannertexture.bannerTexture;
    }
}
项目:BaseClient    文件:TileEntityBannerRenderer.java   
private ResourceLocation func_178463_a(TileEntityBanner bannerObj)
{
    String s = bannerObj.func_175116_e();

    if (s.isEmpty())
    {
        return null;
    }
    else
    {
        TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s);

        if (tileentitybannerrenderer$timedbannertexture == null)
        {
            if (DESIGNS.size() >= 256)
            {
                long i = System.currentTimeMillis();
                Iterator<String> iterator = DESIGNS.keySet().iterator();

                while (iterator.hasNext())
                {
                    String s1 = (String)iterator.next();
                    TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture1 = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s1);

                    if (i - tileentitybannerrenderer$timedbannertexture1.systemTime > 60000L)
                    {
                        Minecraft.getMinecraft().getTextureManager().deleteTexture(tileentitybannerrenderer$timedbannertexture1.bannerTexture);
                        iterator.remove();
                    }
                }

                if (DESIGNS.size() >= 256)
                {
                    return null;
                }
            }

            List<TileEntityBanner.EnumBannerPattern> list1 = bannerObj.getPatternList();
            List<EnumDyeColor> list = bannerObj.getColorList();
            List<String> list2 = Lists.<String>newArrayList();

            for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : list1)
            {
                list2.add("textures/entity/banner/" + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
            }

            tileentitybannerrenderer$timedbannertexture = new TileEntityBannerRenderer.TimedBannerTexture();
            tileentitybannerrenderer$timedbannertexture.bannerTexture = new ResourceLocation(s);
            Minecraft.getMinecraft().getTextureManager().loadTexture(tileentitybannerrenderer$timedbannertexture.bannerTexture, new LayeredColorMaskTexture(BANNERTEXTURES, list2, list));
            DESIGNS.put(s, tileentitybannerrenderer$timedbannertexture);
        }

        tileentitybannerrenderer$timedbannertexture.systemTime = System.currentTimeMillis();
        return tileentitybannerrenderer$timedbannertexture.bannerTexture;
    }
}
项目:BaseClient    文件:TileEntityBannerRenderer.java   
private ResourceLocation func_178463_a(TileEntityBanner bannerObj)
{
    String s = bannerObj.func_175116_e();

    if (s.isEmpty())
    {
        return null;
    }
    else
    {
        TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s);

        if (tileentitybannerrenderer$timedbannertexture == null)
        {
            if (DESIGNS.size() >= 256)
            {
                long i = System.currentTimeMillis();
                Iterator<String> iterator = DESIGNS.keySet().iterator();

                while (iterator.hasNext())
                {
                    String s1 = (String)iterator.next();
                    TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture1 = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s1);

                    if (i - tileentitybannerrenderer$timedbannertexture1.systemTime > 60000L)
                    {
                        Minecraft.getMinecraft().getTextureManager().deleteTexture(tileentitybannerrenderer$timedbannertexture1.bannerTexture);
                        iterator.remove();
                    }
                }

                if (DESIGNS.size() >= 256)
                {
                    return null;
                }
            }

            List<TileEntityBanner.EnumBannerPattern> list1 = bannerObj.getPatternList();
            List<EnumDyeColor> list = bannerObj.getColorList();
            List<String> list2 = Lists.<String>newArrayList();

            for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : list1)
            {
                list2.add("textures/entity/banner/" + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
            }

            tileentitybannerrenderer$timedbannertexture = new TileEntityBannerRenderer.TimedBannerTexture();
            tileentitybannerrenderer$timedbannertexture.bannerTexture = new ResourceLocation(s);
            Minecraft.getMinecraft().getTextureManager().loadTexture(tileentitybannerrenderer$timedbannertexture.bannerTexture, new LayeredColorMaskTexture(BANNERTEXTURES, list2, list));
            DESIGNS.put(s, tileentitybannerrenderer$timedbannertexture);
        }

        tileentitybannerrenderer$timedbannertexture.systemTime = System.currentTimeMillis();
        return tileentitybannerrenderer$timedbannertexture.bannerTexture;
    }
}