daily pastebin goal
29%
SHARE
TWEET

ClientProxy.java

circuitdh Jun 30th, 2016 8 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.bleachcraft.Proxy;
  2.  
  3. import net.bleachcraft.BleachCraft;
  4. import net.bleachcraft.Fluids.ClorineBlock;
  5. import net.minecraft.block.state.IBlockState;
  6. import net.minecraft.client.Minecraft;
  7. import net.minecraft.client.renderer.ItemMeshDefinition;
  8. import net.minecraft.client.renderer.block.model.ModelBakery;
  9. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  10. import net.minecraft.client.renderer.block.statemap.StateMapperBase;
  11. import net.minecraft.item.Item;
  12. import net.minecraft.item.ItemStack;
  13. import net.minecraftforge.client.model.ModelLoader;
  14. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  15.  
  16. public class ClientProxy extends CommonProxy
  17. {
  18.      private static ModelResourceLocation gasLocation = new ModelResourceLocation("bleachcraft" + ":" + ClorineBlock.name, "gas");
  19.  
  20.     @Override
  21.     public void preInit(FMLPreInitializationEvent event)
  22.     {
  23.         super.preInit(event);
  24.         Item gas = Item.getItemFromBlock(ClorineBlock.instance);
  25.         ModelBakery.registerItemVariants(gas);
  26.         ModelLoader.setCustomMeshDefinition(gas, new ItemMeshDefinition()
  27.         {
  28.             public ModelResourceLocation getModelLocation(ItemStack stack)
  29.             {
  30.                 return gasLocation;
  31.             }
  32.         });
  33.         ModelLoader.setCustomStateMapper(ClorineBlock.instance, new StateMapperBase()
  34.         {
  35.             protected ModelResourceLocation getModelResourceLocation(IBlockState state)
  36.             {
  37.                 return gasLocation;
  38.             }
  39.         });
  40.        
  41.        
  42.     }
  43.    
  44.     public static void registerItemRender(Item item, int meta)
  45.     {
  46.         ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory"));
  47.     }
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top