Advertisement
Guest User

The Code

a guest
Feb 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. private void registerFluidBlock(BlockFluidClassic block, String identifier){
  2.         Item item = Item.getItemFromBlock(block);
  3.         final ModelResourceLocation mrl = new ModelResourceLocation(BigCapacitorsMod.modid + ":" + fluidStateModel, identifier);
  4.         ModelBakery.registerItemVariants(item);
  5.         ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition()
  6.         {
  7.             public ModelResourceLocation getModelLocation(ItemStack stack)
  8.             {
  9.                 return mrl;
  10.             }
  11.         });
  12.         ModelLoader.setCustomStateMapper(block, new StateMapperBase()
  13.         {
  14.             protected ModelResourceLocation getModelResourceLocation(IBlockState state)
  15.             {
  16.                 return mrl;
  17.             }
  18.         });
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement