Guest User

Untitled

a guest
Apr 26th, 2015
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. package com.looke81.biowarfare.init;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.block.material.Material;
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.resources.model.ModelResourceLocation;
  7. import net.minecraft.item.Item;
  8. import net.minecraftforge.fml.common.registry.GameRegistry;
  9.  
  10. import com.looke81.biowarfare.BioWarfare;
  11. import com.looke81.biowarfare.Reference;
  12. import com.looke81.biowarfare.blocks.AgarPlate;
  13. import com.looke81.biowarfare.blocks.BacteriaTest;
  14. import com.looke81.biowarfare.blocks.Jelly;
  15. import com.looke81.biowarfare.blocks.MachineCore;
  16. import com.looke81.biowarfare.blocks.MicrobeExtractor;
  17. import com.looke81.biowarfare.blocks.twobytwoDirt;
  18. import com.looke81.biowarfare.blocks.twobytwoDirtcompressed;
  19.  
  20. public class BioWarfareBlocks {
  21.  
  22. public static Block block_AgarPlate;
  23. public static Block block_MicrobeExtractorActive;
  24. public static Block block_MicrobeExtractorIdle;
  25. public static Block block_BacteriaTest;
  26. public static Block block_MachineCore;
  27.  
  28. public static Block block_twobytwoDirt;
  29. public static Block block_twobytwoDirtcompressed;
  30. public static Block block_Jelly;
  31.  
  32. public static void init() {
  33. // Blocks
  34. block_MicrobeExtractorIdle = new MicrobeExtractor(false).setCreativeTab(BioWarfare.BioWarfareTab).setUnlocalizedName("block_MicrobeExtractorIdle");
  35. block_MicrobeExtractorActive = new MicrobeExtractor(true).setLightLevel(0.625F).setUnlocalizedName("block_MicrobeExtractorActive");
  36. block_BacteriaTest = new BacteriaTest(Material.cactus);
  37. block_MachineCore = new MachineCore(Material.rock).setUnlocalizedName("block_MachineCore");
  38.  
  39. block_twobytwoDirt = new twobytwoDirt(Material.rock).setUnlocalizedName("block_twobytwoDirt");
  40. block_twobytwoDirtcompressed = new twobytwoDirtcompressed(Material.rock).setUnlocalizedName("block_twobytwoDirtcompressed");
  41. block_AgarPlate = new AgarPlate(Material.rock).setUnlocalizedName("block_AgarPlate");
  42. block_Jelly = new Jelly(Material.rock).setUnlocalizedName("block_Jelly");
  43. }
  44.  
  45. public static void register() {
  46. GameRegistry.registerBlock(block_MicrobeExtractorIdle, block_MicrobeExtractorIdle.getUnlocalizedName().substring(5));
  47. GameRegistry.registerBlock(block_MicrobeExtractorActive, block_MicrobeExtractorActive.getUnlocalizedName().substring(5));
  48. GameRegistry.registerBlock(block_BacteriaTest, block_BacteriaTest.getUnlocalizedName().substring(5));
  49. GameRegistry.registerBlock(block_MachineCore, block_MachineCore.getUnlocalizedName().substring(5));
  50.  
  51. GameRegistry.registerBlock(block_twobytwoDirt, block_twobytwoDirt.getUnlocalizedName().substring(5));
  52. GameRegistry.registerBlock(block_twobytwoDirtcompressed, block_twobytwoDirtcompressed.getUnlocalizedName().substring(5));
  53. GameRegistry.registerBlock(block_AgarPlate, block_AgarPlate.getUnlocalizedName().substring(5));
  54. GameRegistry.registerBlock(block_Jelly, block_Jelly.getUnlocalizedName().substring(5));
  55. }
  56.  
  57. public static void registerRenders() {
  58.  
  59. registerRender(block_MicrobeExtractorActive);
  60. registerRender(block_MicrobeExtractorIdle);
  61. registerRender(block_MachineCore);
  62.  
  63. registerRender(block_twobytwoDirt);
  64. registerRender(block_twobytwoDirtcompressed);
  65. registerRender(block_Jelly);
  66.  
  67. }
  68.  
  69. public static void registerRender(Block block) {
  70. Item item = Item.getItemFromBlock(block);
  71. Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment