OSDN Git Service

粉塵完成版。チケット完了にしておきます
[chemicraft/chemicraft.git] / common / pcc / chemicraft / item / ItemDust.java
index 6a0cd3b..192545c 100644 (file)
@@ -18,12 +18,15 @@ public class ItemDust extends Item {
        @Override
        public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
                        EntityPlayer par3EntityPlayer) {
-               par2World.spawnEntityInWorld(new EntityDust(par2World,
-                               par3EntityPlayer.posX,
-                               par3EntityPlayer.posY,
-                               par3EntityPlayer.posZ));
+               if (!par2World.isRemote) {
+                       par2World.spawnEntityInWorld(new EntityDust(par2World,
+                                       par3EntityPlayer.posX,
+                                       par3EntityPlayer.posY,
+                                       par3EntityPlayer.posZ));
+                       par1ItemStack.stackSize--;
+               }
                return par1ItemStack;
        }
 
-       
+
 }