GunType gunType = pilotGun.type;
ItemStack bulletItemStack = driveableData.ammo[getDriveableType().numPassengerGunners + currentGun];
//Check that neither is null and that the bullet item is actually a bullet
if(gunType != null && bulletItemStack != null && bulletItemStack.getItem() instanceof ItemShootable && TeamsManager.bulletsEnabled)
{
ShootableType bullet = ((ItemShootable)bulletItemStack.getItem()).type;
if(gunType.isAmmo(bullet))
{
//Spawn a new bullet item
worldObj.spawnEntityInWorld(((ItemShootable)bulletItemStack.getItem()).getEntity(worldObj, Vector3f.add(gunVec, new Vector3f((float)posX, (float)posY, (float)posZ), null), lookVector, (EntityLivingBase)seats[0].riddenByEntity, gunType.bulletSpread / 2, gunType.damage, 2.0F,bulletItemStack.getItemDamage(), type));
//Play the shoot sound