Fluids.java 文件源码

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

项目:BaseMetals 作者:
@SideOnly(Side.CLIENT)
public static void bakeModels(String modID){
    for(Fluid fluid : fluidBlocks.keySet()){
        BlockFluidBase block = fluidBlocks.get(fluid);
        Item item = Item.getItemFromBlock(block);
        final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(
                modID.toLowerCase() + ":" + fluidBlockNames.get(block), "fluid");
           ModelBakery.registerItemVariants(item);
        ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition()
        {
            public ModelResourceLocation getModelLocation(ItemStack stack)
            {
                return fluidModelLocation;
            }
        });
        ModelLoader.setCustomStateMapper(block, new StateMapperBase()
        {
            protected ModelResourceLocation getModelResourceLocation(IBlockState state)
            {
                return fluidModelLocation;
            }
        });
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号