IHasModel.java 文件源码

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

项目:modName 作者:
default public void initModel(ModelRegistryEvent e) 
{
    System.out.println(((IForgeRegistryEntry<?>) this).getRegistryName());
    if (this instanceof Item)
        ModelLoader.setCustomModelResourceLocation((Item) this, 0,
                new ModelResourceLocation(((IForgeRegistryEntry<?>) this).getRegistryName(), "inventory"));
    else if (this instanceof Block)
    {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock((Block) this), 0,
                new ModelResourceLocation(((IForgeRegistryEntry<?>) this).getRegistryName(), "inventory"));
        System.out.println("block");
    }
    else
        throw new IllegalArgumentException("No/invalid object for model");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号