OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / item / ItemGasCollectingBottle.java
index 1cd62aa..990710b 100644 (file)
@@ -7,22 +7,20 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.world.World;
 import pcc.chemicraft.ChemiCraft;
 import pcc.chemicraft.ChemiCraftAPI;
-<<<<<<< HEAD:common/pcc/chemicraft/item/ItemGasCollectingBottle.java
+import pcc.chemicraft.ChemiCraftData;
 import pcc.chemicraft.util.Auxiliary.Probability;
-=======
-import pcc.chemicraft.util.MathHelperPlus;
->>>>>>> a5e4a5c40b9001657f1e36ece533651f63183fbe:common/pcc/chemicraft/item/ItemGasCollectingBottle.java
 
 public class ItemGasCollectingBottle extends ItemAtomInfoContainer
 {
 
        public Probability probability = new Probability();
 
-       public ItemGasCollectingBottle(int id) {
+       public ItemGasCollectingBottle(int id)
+       {
                super(id);
                this.setMaxStackSize(1);
                this.setMaxDamage(2);
-               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+               this.setCreativeTab(ChemiCraft.instance.creativeTabChemiCraft);
        }
 
        @Override
@@ -32,38 +30,31 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
 
                this.atomInfo.update(par2World, par3EntityPlayer);
 
-               int heightValue = par2World.getHeightValue((int) par3EntityPlayer.posX, (int) par3EntityPlayer.posZ);
+               int heightValue = par2World.getHeightValue((int)par3EntityPlayer.posX, (int)par3EntityPlayer.posZ);
 
-               int result1 = probability.getProbability(99.0D, 1.0D);
-               int result2 = probability.getProbability(78.0D, 21.0D, 1.0D);
-               int result3 = probability.getProbability(0.032D, 0.0018D, 0.000012D, 0.00052D);
+               int result = probability.getProbability(78.0D, 21.0D, 1.0D, 0.032D, 0.0018D, 0.000012D, 0.00052D, 0.000114D, 0.000087D);
                if (this.atomInfo.isOverY(heightValue)) {
-                       if (result1 == 0) {
-                               if (result2 == 0) {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 6), par3EntityPlayer);
-                               } else if (result2 == 1) {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 7), par3EntityPlayer);
-                               } else {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 17), par3EntityPlayer);
-                               }
+                       if (result == 0) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.NITROGEN), par3EntityPlayer);
+                       } else if (result == 1) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.OXYGEN), par3EntityPlayer);
+                       } else if (result == 2) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.ARGON), par3EntityPlayer);
+                       } else if (result == 3) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance().getCompound("CarbonDioxide")), par3EntityPlayer);
+                       } else if (result == 4) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.NEON), par3EntityPlayer);
+                       } else if (result == 5) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance().getCompound("CarbonMonoxide")), par3EntityPlayer);
+                       } else if (result == 6) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.LITHIUM), par3EntityPlayer);
+                       } else if (result == 7) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.KRYPTON), par3EntityPlayer);
                        } else {
-                               if (result3 == 0) {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance().getCompound("CarbonDioxide")), par3EntityPlayer);
-                               } else if (result3 == 1) {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 9), par3EntityPlayer);
-                               } else if (result3 == 2) {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, 1), par3EntityPlayer);
-                               } else {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 1), par3EntityPlayer);
-                               }
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.XENON), par3EntityPlayer);
                        }
                }
 
-               // デバッグ用
-               if (par2World.isRemote) {
-                       par3EntityPlayer.addChatMessage("result1=" + result1 + " result2=" + result2 + " result3=" + result3);
-               }
-
                return par1ItemStack;
        }
 
@@ -83,7 +74,7 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
                int uniqueBlockID = par3World.getBlockId(par4, par5 + 1, par6);
                Block uniqueBlock = Block.blocksList[uniqueBlockID];
 
-               if (uniqueBlock instanceof BlockFire){
+               if (uniqueBlock instanceof BlockFire) {
                        par1ItemStack.damageItem(1, par2EntityPlayer);
 
                        int result1 = probability.getProbability(99, 1);
@@ -102,7 +93,7 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
        @Override
        public String getTextureFile()
        {
-               return "/chemicraft/items/items.png";
+               return ChemiCraft.instance.ITEM_TEXTURE;
        }
 
 }