OSDN Git Service

dce3bab830d63e521bb061b988947a662c587d7e
[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.client.renderer.texture.IconRegister;
8 import net.minecraft.creativetab.CreativeTabs;
9 import net.minecraft.item.ItemStack;
10 import net.minecraft.util.Icon;
11 import pcc.chemicraft.base.ChemiCraftBase;
12 import pcc.chemicraft.core.ChemiCraftCore;
13 import cpw.mods.fml.relauncher.Side;
14 import cpw.mods.fml.relauncher.SideOnly;
15
16 /**
17  * 鉱石のクラスです
18  * @author mozipi,ponkotate
19  */
20 public class BlockAtomOres extends Block {
21
22         @SideOnly(Side.CLIENT)
23     private Icon[] iconArray;
24
25         public BlockAtomOres(int id) {
26                 super(id, Material.rock);
27                 this.setCreativeTab(ChemiCraftBase.instance.creativeTabAtomsOre);
28         }
29
30         @Override
31         @SideOnly(Side.CLIENT)
32         public void registerIcons(IconRegister par1IconRegister) {
33                 this.iconArray = new Icon[ChemiCraftCore.ATOMSNAME.length];
34
35                 for (int i = 0; i < this.iconArray.length; i++){
36                         this.iconArray[i] = par1IconRegister.registerIcon(ChemiCraftBase.ORE + "WIP");
37                 }
38         }
39
40         @Override
41         public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
42                 int var3 = this.blockID - ChemiCraftBase.instance.atomOresID[0];
43                 return this.iconArray[var3 - var3 / 16 * 16];
44         }
45
46         @Override
47         public int damageDropped(int par1) {
48                 return par1;
49         }
50
51         public static int getBlockFromDye(int par0) {
52                 return ~par0 & 15;
53         }
54
55         public static int getDyeFromBlock(int par0) {
56                 return ~par0 & 15;
57         }
58
59         @Override
60         @SideOnly(Side.CLIENT)
61         public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
62                 for (int var4 = 0; var4 < 16; ++var4) {
63                         par3List.add(new ItemStack(par1, 1, var4));
64                 }
65         }
66
67 }