Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Blocks {
- public static PeriodicOre oreLithium;
- public static PeriodicOre oreBoron;
- public static PeriodicOre oreCarbon;
- public static PeriodicOre oreBeryllium;
- public static PeriodicOre oreTitanium;
- public static PeriodicOre oreVanadium;
- public static PeriodicOre oreChromium;
- public static PeriodicOre oreManganese;
- public static PeriodicOre oreCobalt;
- public static PeriodicOre oreNickel;
- public static PeriodicOre oreCopper;
- public static PeriodicOre oreZinc;
- public static Map<String, PeriodicOre> allOres = new HashMap<String, PeriodicOre>();
- public static boolean initDone = false;
- public static WrappedGenerator generator;
- public static void init() {
- if (initDone) return;
- oreTitanium = addOre("oreTitanium", 4.0F);
- oreVanadium = addOre( "oreVanadium", 4.0F);
- oreChromium = addOre( "oreChromium", 3.5F);
- oreManganese = addOre( "oreManganese", 4.0F);
- oreCobalt = addOre( "oreCobalt", 4.5F);
- oreNickel = addOre("oreNickel", 4.0F);
- oreCopper = addOre("oreCopper", 3.5F);
- oreZinc = addOre("oreZinc", 3.0F);
- oreLithium = addOre("oreLithium", 4.0F);
- oreBoron = addOre("oreBoron", 3.5F);
- oreCarbon = addOre("oreCarbon", 4.5F);
- oreBeryllium = addOre("oreBeryllium", 3.5F);
- generateOre();
- initDone = true;
- }
- public static PeriodicOre addOre(String name,
- float hardness) {
- PeriodicOre ore = new PeriodicOre();
- ore.setUnlocalizedName(name);
- GameRegistry.registerBlock(ore, name);
- ore.setCreativeTab(CreativeTabs.tabBlock);
- allOres.put(name, ore);
- return ore;
- }
- private static void generateOre() {
- {
- generator = new WrappedGenerator(0,
- /***
- * @param block
- * ,
- * @param max_height
- * ,
- * @param blocks_per_vein
- * ,
- * @param veins_per_chunk
- */
- new Instruction(oreLithium, 64, 5, 7).setOverworld(true),
- new Instruction(oreBoron, 64, 5, 7).setOverworld(true),
- new Instruction(oreCarbon, 64, 5, 7).setOverworld(true),
- new Instruction(oreBeryllium, 64, 5, 7).setOverworld(true),
- new Instruction(oreTitanium, 64, 5, 7).setOverworld(true),
- new Instruction(oreVanadium, 64, 5, 7).setOverworld(true),
- new Instruction(oreChromium, 64, 5, 7).setOverworld(true),
- new Instruction(oreManganese, 64, 5, 7).setOverworld(true),
- new Instruction(oreCobalt, 64, 5, 7).setOverworld(true),
- new Instruction(oreNickel, 64, 5, 7).setOverworld(true),
- new Instruction(oreCopper, 64, 5, 7).setOverworld(true),
- new Instruction(oreZinc, 64, 5, 7).setOverworld(true));
- }
- }
- @SideOnly(Side.CLIENT)
- public static void registerBlockRenderers(FMLInitializationEvent event) {
- for(Map.Entry<String, PeriodicOre> e : allOres.entrySet()) {
- String name = e.getKey();
- Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
- .register(Item.getItemFromBlock(e.getValue()), 0,
- new ModelResourceLocation(PCM.MODID + ":model/" + name, "inventory"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement