RenderItem.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:Backmemed 作者:
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;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号