OSDN Git Service

鉱石追加用クラス・API等を追加or更新
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ore / BlockAtomsOre.java
1 package pcc.chemicraft.ore;
2
3 import java.util.List;
4
5 import net.minecraft.block.Block;
6 import net.minecraft.block.material.Material;
7 import net.minecraft.creativetab.CreativeTabs;
8 import net.minecraft.item.ItemStack;
9 import pcc.chemicraft.ChemiCraft;
10 import cpw.mods.fml.relauncher.Side;
11 import cpw.mods.fml.relauncher.SideOnly;
12
13 public class BlockAtomsOre extends Block
14 {
15
16         public BlockAtomsOre(int id)
17         {
18                 super(id, Material.rock);
19                 this.setCreativeTab(ChemiCraft.instance.creativeTab);
20         }
21
22         @Override
23         public int getBlockTextureFromSideAndMetadata(int par1, int par2)
24         {
25                 return (this.blockID - ChemiCraft.instance.atomsOreID[0]) * 16 + par2;
26         }
27
28         @Override
29         public int damageDropped(int par1)
30         {
31                 return par1;
32         }
33
34         public static int getBlockFromDye(int par0)
35         {
36                 return ~par0 & 15;
37         }
38
39         public static int getDyeFromBlock(int par0)
40         {
41                 return ~par0 & 15;
42         }
43
44         @Override
45         @SideOnly(Side.CLIENT)
46         public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
47         {
48                 for (int var4 = 0; var4 < 16; ++var4) {
49                         par3List.add(new ItemStack(par1, 1, var4));
50                 }
51         }
52
53         @Override
54         public String getTextureFile()
55         {
56                 return ChemiCraft.instance.BLOCK_ATOMS_ORE_TEXTURE;
57         }
58
59 }