Advertisement
circuitdh

ClientProxy.java

Jun 28th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement