Advertisement
Guest User

Blocks.java

a guest
Jun 29th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. public abstract class Blocks {
  2.  
  3. public static PeriodicOre oreLithium;
  4. public static PeriodicOre oreBoron;
  5. public static PeriodicOre oreCarbon;
  6. public static PeriodicOre oreBeryllium;
  7. public static PeriodicOre oreTitanium;
  8. public static PeriodicOre oreVanadium;
  9. public static PeriodicOre oreChromium;
  10. public static PeriodicOre oreManganese;
  11. public static PeriodicOre oreCobalt;
  12. public static PeriodicOre oreNickel;
  13. public static PeriodicOre oreCopper;
  14. public static PeriodicOre oreZinc;
  15. public static Map<String, PeriodicOre> allOres = new HashMap<String, PeriodicOre>();
  16. public static boolean initDone = false;
  17. public static WrappedGenerator generator;
  18.  
  19. public static void init() {
  20. if (initDone) return;
  21. oreTitanium = addOre("oreTitanium", 4.0F);
  22. oreVanadium = addOre( "oreVanadium", 4.0F);
  23. oreChromium = addOre( "oreChromium", 3.5F);
  24. oreManganese = addOre( "oreManganese", 4.0F);
  25. oreCobalt = addOre( "oreCobalt", 4.5F);
  26. oreNickel = addOre("oreNickel", 4.0F);
  27. oreCopper = addOre("oreCopper", 3.5F);
  28. oreZinc = addOre("oreZinc", 3.0F);
  29. oreLithium = addOre("oreLithium", 4.0F);
  30. oreBoron = addOre("oreBoron", 3.5F);
  31. oreCarbon = addOre("oreCarbon", 4.5F);
  32. oreBeryllium = addOre("oreBeryllium", 3.5F);
  33. generateOre();
  34. initDone = true;
  35. }
  36.  
  37. public static PeriodicOre addOre(String name,
  38. float hardness) {
  39. PeriodicOre ore = new PeriodicOre();
  40. ore.setUnlocalizedName(name);
  41. GameRegistry.registerBlock(ore, name);
  42. ore.setCreativeTab(CreativeTabs.tabBlock);
  43. allOres.put(name, ore);
  44. return ore;
  45. }
  46.  
  47. private static void generateOre() {
  48. {
  49. generator = new WrappedGenerator(0,
  50. /***
  51. * @param block
  52. * ,
  53. * @param max_height
  54. * ,
  55. * @param blocks_per_vein
  56. * ,
  57. * @param veins_per_chunk
  58. */
  59.  
  60. new Instruction(oreLithium, 64, 5, 7).setOverworld(true),
  61. new Instruction(oreBoron, 64, 5, 7).setOverworld(true),
  62. new Instruction(oreCarbon, 64, 5, 7).setOverworld(true),
  63. new Instruction(oreBeryllium, 64, 5, 7).setOverworld(true),
  64. new Instruction(oreTitanium, 64, 5, 7).setOverworld(true),
  65. new Instruction(oreVanadium, 64, 5, 7).setOverworld(true),
  66. new Instruction(oreChromium, 64, 5, 7).setOverworld(true),
  67. new Instruction(oreManganese, 64, 5, 7).setOverworld(true),
  68. new Instruction(oreCobalt, 64, 5, 7).setOverworld(true),
  69. new Instruction(oreNickel, 64, 5, 7).setOverworld(true),
  70. new Instruction(oreCopper, 64, 5, 7).setOverworld(true),
  71. new Instruction(oreZinc, 64, 5, 7).setOverworld(true));
  72. }
  73. }
  74.  
  75. @SideOnly(Side.CLIENT)
  76. public static void registerBlockRenderers(FMLInitializationEvent event) {
  77. for(Map.Entry<String, PeriodicOre> e : allOres.entrySet()) {
  78. String name = e.getKey();
  79. Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  80. .register(Item.getItemFromBlock(e.getValue()), 0,
  81. new ModelResourceLocation(PCM.MODID + ":model/" + name, "inventory"));
  82. }
  83. }
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement