@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;
}
});
}
}
Fluids.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:BaseMetals
作者:
评论列表
文章目录