OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ore / BlockAtomOres.java
index 8f918bd..02cd35c 100644 (file)
@@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.util.Icon;
 import net.minecraft.world.World;
 import pcc.chemicraft.base.ChemiCraftBase;
+import pcc.chemicraft.base.ChemiCraftBaseAPI;
 import pcc.chemicraft.core.ChemiCraftCore;
 import cpw.mods.fml.relauncher.Side;
 import cpw.mods.fml.relauncher.SideOnly;
@@ -42,7 +43,7 @@ public class BlockAtomOres extends Block {
        @Override
        public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
                int var3 = this.blockID - ChemiCraftBase.instance.atomOresID[0];
-               return this.iconArray[var3 - var3 / 16 * 16];
+               return this.iconArray[par2 + var3 * 16];
        }
 
        @Override
@@ -61,8 +62,13 @@ public class BlockAtomOres extends Block {
        @Override
        @SideOnly(Side.CLIENT)
        public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
-               for (int var4 = 0; var4 < 16; ++var4) {
-                       par3List.add(new ItemStack(par1, 1, var4));
+               int var4 = this.blockID - ChemiCraftBase.instance.atomOresID[0] + 1;
+               int var5 = 16;
+               if (var4 == ChemiCraftBase.instance.atomOresID.length){
+                       var5 -= var4 * 16 - ChemiCraftBaseAPI.instance().getAtomOresAtomName().size();
+               }
+               for (int i = 0; i < var5; i++) {
+                       par3List.add(new ItemStack(par1, 1, i));
                }
        }