OSDN Git Service

1a38df1a6170e974641f9f6a578d41f5b742c67c
[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 /**
15  * 鉱石のクラスです
16  * @author mozipi,ponkotate
17  */
18 public class BlockAtomOres extends Block {
19
20         public BlockAtomOres(int id) {
21                 super(id, Material.rock);
22                 this.setCreativeTab(ChemiCraftBase.instance.creativeTabAtomsOre);
23         }
24
25         @Override
26         public int getBlockTextureFromSideAndMetadata(int par1, int par2) {
27                 return (this.blockID - ChemiCraftBase.instance.atomOresID[0]) * 16 + par2;
28         }
29
30         @Override
31         public int damageDropped(int par1) {
32                 return par1;
33         }
34
35         public static int getBlockFromDye(int par0) {
36                 return ~par0 & 15;
37         }
38
39         public static int getDyeFromBlock(int par0) {
40                 return ~par0 & 15;
41         }
42
43         @Override
44         @SideOnly(Side.CLIENT)
45         public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
46                 for (int var4 = 0; var4 < 16; ++var4) {
47                         par3List.add(new ItemStack(par1, 1, var4));
48                 }
49         }
50
51         @Override
52         public String getTextureFile() {
53                 return ChemiCraftCore.instance.BLOCK_ATOMS_ORE_TEXTURE;
54         }
55
56 }