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


Java Item.hasCustomProperties方法代码示例

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


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

示例1: getItemModelWithOverrides

import net.minecraft.item.Item; //导入方法依赖的package包/类
public IBakedModel getItemModelWithOverrides(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entitylivingbaseIn)
{
    IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
    Item item = stack.getItem();

    if (Config.isCustomItems() && item != null && item.hasCustomProperties())
    {
        this.modelLocation = ibakedmodel.getOverrides().applyOverride(stack, worldIn, entitylivingbaseIn);
    }

    if (Reflector.ForgeItemOverrideList_handleItemState.exists())
    {
        return (IBakedModel)Reflector.call(ibakedmodel.getOverrides(), Reflector.ForgeItemOverrideList_handleItemState, new Object[] {ibakedmodel, stack, worldIn, entitylivingbaseIn});
    }
    else if (item != null && item.hasCustomProperties())
    {
        ResourceLocation resourcelocation = ibakedmodel.getOverrides().applyOverride(stack, worldIn, entitylivingbaseIn);
        return resourcelocation == null ? ibakedmodel : this.itemModelMesher.getModelManager().getModel(new ModelResourceLocation(resourcelocation, "inventory"));
    }
    else
    {
        return ibakedmodel;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:RenderItem.java

示例2: loadItemModels

import net.minecraft.item.Item; //导入方法依赖的package包/类
private void loadItemModels()
{
    this.registerVariantNames();

    for (Item item : Item.REGISTRY)
    {
        for (String s : this.getVariantNames(item))
        {
            ResourceLocation resourcelocation = this.getItemLocation(s);
            ResourceLocation resourcelocation1 = (ResourceLocation)Item.REGISTRY.getNameForObject(item);
            this.loadItemModel(s, resourcelocation, resourcelocation1);

            if (item.hasCustomProperties())
            {
                ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);

                if (modelblock != null)
                {
                    for (ResourceLocation resourcelocation2 : modelblock.getOverrideLocations())
                    {
                        this.loadItemModel(resourcelocation2.toString(), resourcelocation2, resourcelocation1);
                    }
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:ModelBakery.java

示例3: loadItemModels

import net.minecraft.item.Item; //导入方法依赖的package包/类
protected void loadItemModels()
{
    this.registerVariantNames();

    for (Item item : Item.REGISTRY)
    {
        for (String s : this.getVariantNames(item))
        {
            ResourceLocation resourcelocation = this.getItemLocation(s);
            ResourceLocation resourcelocation1 = (ResourceLocation)Item.REGISTRY.getNameForObject(item);
            this.loadItemModel(s, resourcelocation, resourcelocation1);

            if (item.hasCustomProperties())
            {
                ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);

                if (modelblock != null)
                {
                    for (ResourceLocation resourcelocation2 : modelblock.getOverrideLocations())
                    {
                        this.loadItemModel(resourcelocation2.toString(), resourcelocation2, resourcelocation1);
                    }
                }
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:ModelBakery.java


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