當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。