@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;
}
}
BannerTextures.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:CustomWorldGen
作者:
评论列表
文章目录