OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ore / BlockAtomOres.java
index 96bb8bb..dce3bab 100644 (file)
@@ -4,6 +4,7 @@ import java.util.List;
 
 import net.minecraft.block.Block;
 import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
 import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Icon;
@@ -18,17 +19,29 @@ import cpw.mods.fml.relauncher.SideOnly;
  */
 public class BlockAtomOres extends Block {
 
+       @SideOnly(Side.CLIENT)
+    private Icon[] iconArray;
+
        public BlockAtomOres(int id) {
                super(id, Material.rock);
                this.setCreativeTab(ChemiCraftBase.instance.creativeTabAtomsOre);
        }
 
-       /* 一時保留。詳しい事が決まらないと、変更が難しいため。 --WIP--
+       @Override
+       @SideOnly(Side.CLIENT)
+       public void registerIcons(IconRegister par1IconRegister) {
+               this.iconArray = new Icon[ChemiCraftCore.ATOMSNAME.length];
+
+               for (int i = 0; i < this.iconArray.length; i++){
+                       this.iconArray[i] = par1IconRegister.registerIcon(ChemiCraftBase.ORE + "WIP");
+               }
+       }
+
        @Override
        public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
-               return (this.blockID - ChemiCraftBase.instance.atomOresID[0]) * 16 + par2;
+               int var3 = this.blockID - ChemiCraftBase.instance.atomOresID[0];
+               return this.iconArray[var3 - var3 / 16 * 16];
        }
-       */
 
        @Override
        public int damageDropped(int par1) {