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


Java ModelManager.getMissingModel方法代码示例

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


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

示例1: makeModel

import net.minecraft.client.renderer.block.model.ModelManager; //导入方法依赖的package包/类
public static IBakedModel makeModel(String p_makeModel_0_, TextureAtlasSprite p_makeModel_1_, TextureAtlasSprite p_makeModel_2_)
{
    if (p_makeModel_1_ != null && p_makeModel_2_ != null)
    {
        ModelManager modelmanager = Config.getModelManager();

        if (modelmanager == null)
        {
            return null;
        }
        else
        {
            ModelResourceLocation modelresourcelocation = new ModelResourceLocation(p_makeModel_0_, "normal");
            IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation);

            if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel())
            {
                IBakedModel ibakedmodel1 = ModelUtils.duplicateModel(ibakedmodel);
                EnumFacing[] aenumfacing = EnumFacing.VALUES;

                for (int i = 0; i < aenumfacing.length; ++i)
                {
                    EnumFacing enumfacing = aenumfacing[i];
                    List<BakedQuad> list = ibakedmodel1.getQuads((IBlockState)null, enumfacing, 0L);
                    replaceTexture(list, p_makeModel_1_, p_makeModel_2_);
                }

                List<BakedQuad> list1 = ibakedmodel1.getQuads((IBlockState)null, (EnumFacing)null, 0L);
                replaceTexture(list1, p_makeModel_1_, p_makeModel_2_);
                return ibakedmodel1;
            }
            else
            {
                return null;
            }
        }
    }
    else
    {
        return null;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:43,代码来源:BlockModelUtils.java

示例2: getModelCull

import net.minecraft.client.renderer.block.model.ModelManager; //导入方法依赖的package包/类
static IBakedModel getModelCull(String p_getModelCull_0_, List p_getModelCull_1_)
{
    ModelManager modelmanager = Config.getModelManager();

    if (modelmanager == null)
    {
        return null;
    }
    else
    {
        ResourceLocation resourcelocation = new ResourceLocation("blockstates/" + p_getModelCull_0_ + "_leaves.json");

        if (Config.getDefiningResourcePack(resourcelocation) != Config.getDefaultResourcePack())
        {
            return null;
        }
        else
        {
            ResourceLocation resourcelocation1 = new ResourceLocation("models/block/" + p_getModelCull_0_ + "_leaves.json");

            if (Config.getDefiningResourcePack(resourcelocation1) != Config.getDefaultResourcePack())
            {
                return null;
            }
            else
            {
                ModelResourceLocation modelresourcelocation = new ModelResourceLocation(p_getModelCull_0_ + "_leaves", "normal");
                IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation);

                if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel())
                {
                    List list = ibakedmodel.getQuads((IBlockState)null, (EnumFacing)null, 0L);

                    if (list.size() == 0)
                    {
                        return ibakedmodel;
                    }
                    else if (list.size() != 6)
                    {
                        return null;
                    }
                    else
                    {
                        for (Object bakedquad : list)
                        {
                            List list1 = ibakedmodel.getQuads((IBlockState)null, ((BakedQuad) bakedquad).getFace(), 0L);

                            if (list1.size() > 0)
                            {
                                return null;
                            }

                            list1.add(bakedquad);
                        }

                        list.clear();
                        p_getModelCull_1_.add(p_getModelCull_0_ + "_leaves");
                        return ibakedmodel;
                    }
                }
                else
                {
                    return null;
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:69,代码来源:SmartLeaves.java


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