OSDN Git Service

放射線銃完成
[chemicraft/chemicraft.git] / common / pcc / chemicraft / item / ItemCompounds.java
index 6eb6531..267b090 100644 (file)
@@ -19,14 +19,14 @@ public class ItemCompounds extends Item {
                super(par1);
                this.setHasSubtypes(true);
                this.setMaxDamage(0);
-               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+               this.setCreativeTab(ChemiCraft.instance.creativeTabChemiCraft);
        }
 
        @Override
        public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
                try {
                        for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
-                               if(ChemiCraftAPI.instance().getCompoundsName().get(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
+                               if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
                                        return ChemiCraftAPI.instance().getCompoundHandler().get(i).onItemUseHandler(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
                                }
                        }
@@ -42,7 +42,7 @@ public class ItemCompounds extends Item {
        {
                try {
                        for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
-                               if(ChemiCraftAPI.instance().getCompoundsName().get(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
+                               if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
                                        ChemiCraftAPI.instance().getCompoundHandler().get(i).onItemRightClickHandler(par1ItemStack, par2World, par3EntityPlayer);
                                }
                        }
@@ -58,7 +58,7 @@ public class ItemCompounds extends Item {
        public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
                try {
                        for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
-                               if(ChemiCraftAPI.instance().getCompoundsName().get(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
+                               if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
                                        ChemiCraftAPI.instance().getCompoundHandler().get(i).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
                                }
                        }
@@ -74,7 +74,7 @@ public class ItemCompounds extends Item {
        @SideOnly(Side.CLIENT)
        @Override
        public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
-               for(int type = 0; type < ChemiCraftAPI.instance().getCompoundsName().toArray().length; type++)
+               for(int type = 0; type < ChemiCraftAPI.instance().getCompoundsName().sizeKeysList(); type++)
                {
                        par3List.add(new ItemStack(par1, 1, type));
                        this.setIconIndex(type);
@@ -86,7 +86,7 @@ public class ItemCompounds extends Item {
        @Override
        public String getItemNameIS(ItemStack par1ItemStack){
                try {
-                       return super.getItemName() + "." + ChemiCraftAPI.instance().getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
+                       return super.getItemName() + "." + ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage());
                } catch (ArrayIndexOutOfBoundsException e) {
                        par1ItemStack.stackSize = 0;
                }
@@ -107,7 +107,7 @@ public class ItemCompounds extends Item {
        public int getIconFromDamage(int par1){
                try {
                        for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
-                               if(ChemiCraftAPI.instance().getCompoundsName().get(par1).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
+                               if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
                                        return ChemiCraftAPI.instance().getCompoundHandler().get(i).getIconIndexHandler();
                                }
                        }