OSDN Git Service

9e46de781e27dd412a8650a23c7fbe9b170ec425
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ore / BlockAtomOres.java
1 package pcc.chemicraft.base.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.base.ChemiCraftBase;
10 import pcc.chemicraft.core.ChemiCraftCore;
11 import cpw.mods.fml.relauncher.Side;
12 import cpw.mods.fml.relauncher.SideOnly;
13
14 public class BlockAtomOres extends Block
15 {
16
17         public BlockAtomOres(int id)
18         {
19                 super(id, Material.rock);
20                 this.setCreativeTab(ChemiCraftBase.instance.creativeTabAtomsOre);
21         }
22
23         @Override
24         public int getBlockTextureFromSideAndMetadata(int par1, int par2)
25         {
26                 return (this.blockID - ChemiCraftBase.instance.atomOresID[0]) * 16 + par2;
27         }
28
29         @Override
30         public int damageDropped(int par1)
31         {
32                 return par1;
33         }
34
35         public static int getBlockFromDye(int par0)
36         {
37                 return ~par0 & 15;
38         }
39
40         public static int getDyeFromBlock(int par0)
41         {
42                 return ~par0 & 15;
43         }
44
45         @Override
46         @SideOnly(Side.CLIENT)
47         public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
48         {
49                 for (int var4 = 0; var4 < 16; ++var4) {
50                         par3List.add(new ItemStack(par1, 1, var4));
51                 }
52         }
53
54         @Override
55         public String getTextureFile()
56         {
57                 return ChemiCraftCore.instance.BLOCK_ATOMS_ORE_TEXTURE;
58         }
59
60 }