Advertisement
circuitdh

ClientProxy.java

Jun 18th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1. package net.BleachCraft;
  2.  
  3. import net.minecraft.block.state.IBlockState;
  4. import net.minecraft.client.renderer.ItemMeshDefinition;
  5. import net.minecraft.client.renderer.block.model.ModelBakery;
  6. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  7. import net.minecraft.client.renderer.block.statemap.StateMapperBase;
  8. import net.minecraft.item.Item;
  9. import net.minecraft.item.ItemStack;
  10. import net.minecraftforge.client.model.ModelLoader;
  11. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  12.  
  13. public class ClientProxy extends CommonProxy
  14. {
  15.      private static ModelResourceLocation gasLocation = new ModelResourceLocation(MODID.toLowerCase() + ":" + ClorineBlock.name, "gas");
  16.  
  17.     @Override
  18.     public void preInit(FMLPreInitializationEvent event)
  19.     {
  20.         super.preInit(event);
  21.         Item gas = Item.getItemFromBlock(ClorineBlock.instance);
  22.         ModelBakery.registerItemVariants(gas);
  23.         ModelLoader.setCustomMeshDefinition(gas, new ItemMeshDefinition()
  24.         {
  25.             public ModelResourceLocation getModelLocation(ItemStack stack)
  26.             {
  27.                 return gasLocation;
  28.             }
  29.         });
  30.         ModelLoader.setCustomStateMapper(ClorineBlock.instance, new StateMapperBase()
  31.         {
  32.             protected ModelResourceLocation getModelResourceLocation(IBlockState state)
  33.             {
  34.                 return gasLocation;
  35.             }
  36.         });
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement