BannerTextures.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:ExpandedRailsMod 作者:
@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;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号