Exemple #1
0
 public override void onCollideWithPlayer(EntityPlayer entityplayer)
 {
     if (inGround && field_20083_aj == entityplayer && shake <= 0 &&
         entityplayer.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1)))
     {
         worldObj.playSoundAtEntity(this, "random.pop", 0.2F,
                                    ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
         entityplayer.onItemPickup(this, 1);
         setEntityDead();
     }
 }
Exemple #2
0
 public override void onCollideWithPlayer(EntityPlayer entityplayer)
 {
     if (worldObj.singleplayerWorld)
     {
         return;
     }
     int i = item.stackSize;
     if (delayBeforeCanPickup == 0 && entityplayer.inventory.addItemStackToInventory(item))
     {
         worldObj.playSoundAtEntity(this, "random.pop", 0.2F,
                                    ((rand.nextFloat() - rand.nextFloat())*0.7F + 1.0F)*2.0F);
         entityplayer.onItemPickup(this, i);
         setEntityDead();
     }
 }
Exemple #3
0
        public override void onCollideWithPlayer(EntityPlayer entityplayer)
        {
            if (worldObj.singleplayerWorld)
            {
                return;
            }
            int i = item.stackSize;

            if (delayBeforeCanPickup == 0 && entityplayer.inventory.addItemStackToInventory(item))
            {
                worldObj.playSoundAtEntity(this, "random.pop", 0.2F,
                                           ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                entityplayer.onItemPickup(this, i);
                setEntityDead();
            }
        }
Exemple #4
0
 public override void onCollideWithPlayer(EntityPlayer entityplayer)
 {
     if (inGroundSnowball && owner == entityplayer && shakeSnowball <= 0 &&
         entityplayer.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1)))
     {
         worldObj.playSoundAtEntity(this, "random.pop", 0.2F,
                                    ((rand.nextFloat() - rand.nextFloat())*0.7F + 1.0F)*2.0F);
         entityplayer.onItemPickup(this, 1);
         setEntityDead();
     }
 }