OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / chemicraft / item / ItemGasCollectingBottle.java
index 73e408a..fd8cca2 100644 (file)
@@ -1,10 +1,10 @@
 package chemicraft.item;
 
-import net.minecraft.src.Block;
-import net.minecraft.src.BlockFire;
-import net.minecraft.src.EntityPlayer;
-import net.minecraft.src.ItemStack;
-import net.minecraft.src.World;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFire;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
 import chemicraft.ChemiCraft;
 import chemicraft.ChemiCraftAPI;
 import chemicraft.util.MathHelperPlus;
@@ -42,7 +42,7 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
                                }
                        } else {
                                if (result3 == 0) {
-                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance.getCompound("CarbonDioxide")), par3EntityPlayer);
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par3EntityPlayer);
                                } else if (result3 == 1) {
                                        this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 9), par3EntityPlayer);
                                } else if (result3 == 2) {
@@ -56,12 +56,13 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
                // デバッグ用
                if (par2World.isRemote) {
                        par3EntityPlayer.addChatMessage("result1=" + result1 + " result2=" + result2 + " result3=" + result3);
+                       par3EntityPlayer.addChatMessage("このメッセージは開発版のみの表示ですが、もし製品版で表示されていた場合はご連絡ください。");
                }
 
                return par1ItemStack;
        }
 
-       public void isStackOrDrop(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer)
+       protected void isStackOrDrop(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer)
        {
                if (!par2EntityPlayer.inventory.addItemStackToInventory(par1ItemStack)) {
                        par2EntityPlayer.dropPlayerItem(par1ItemStack);
@@ -71,18 +72,21 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
        @Override
        public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
        {
-               int var11 = par3World.getBlockId(par4, par5, par6);
-               Block block = Block.blocksList[var11];
+               int blockID = par3World.getBlockId(par4, par5, par6);
+               Block block = Block.blocksList[blockID];
 
-               if (block instanceof BlockFire){
+               int uniqueBlockID = par3World.getBlockId(par4, par5 + 1, par6);
+               Block uniqueBlock = Block.blocksList[uniqueBlockID];
+
+               if (uniqueBlock instanceof BlockFire){
                        par1ItemStack.damageItem(1, par2EntityPlayer);
 
-                       int result1 = MathHelperPlus.probability(99, 1);
+                       int result1 = MathHelperPlus.probability(90, 10);
 
                        if (result1 == 0) {
-                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance.getCompound("CarbonDioxide")), par2EntityPlayer);
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par2EntityPlayer);
                        } else {
-                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 17), par2EntityPlayer);
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonMonoxide")), par2EntityPlayer);
                        }
 
                        return true;