OSDN Git Service

いろいろした
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ChemiCraftRegisterBlock.java
1 package pcc.chemicraft.base;
2
3 import net.minecraft.block.Block;
4 import net.minecraftforge.common.MinecraftForge;
5 import pcc.chemicraft.base.gen.WorldGenAtomsOre;
6 import pcc.chemicraft.base.ore.BlockAtomOres;
7 import pcc.chemicraft.base.ore.ItemAtomOres;
8 import cpw.mods.fml.common.registry.GameRegistry;
9
10 /**
11  * Blockを追加します
12  * @author mozipi,ponkotate
13  */
14 public class ChemiCraftRegisterBlock extends ChemiCraftBaseRegister {
15
16         public ChemiCraftRegisterBlock(ChemiCraftBase mod) {
17                 super(mod);
18         }
19
20         @Override
21         public void start() {
22                 //鉱石を変数に代入
23                 for (int i = 0; i < this.mod.blockAtomOres.length; i++) {
24                         this.mod.blockAtomOres[i] = new BlockAtomOres(this.mod.atomOresID[i]).
25                                         setHardness(3.0F).setResistance(0.0F).
26                                         setStepSound(Block.soundStoneFootstep).setBlockName("AtomsOre" + i);
27                         //鉱石をMinecraftに登録
28                         GameRegistry.registerBlock(this.mod.blockAtomOres[i], ItemAtomOres.class, "AtomsOre" + i);
29                         //回収&最適に破壊できるピッケルのレベルを設定
30                         MinecraftForge.setBlockHarvestLevel(this.mod.blockAtomOres[i], "pickaxe", 2);
31                 }
32         }
33
34 }