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


Java TileEntityBanner.getColorList方法代码示例

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


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

示例1: func_178463_a

import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
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;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:57,代码来源:TileEntityBannerRenderer.java


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