public bool HasAmmo(AmmoTypes ammoType) { ItemModProjectile component; if (info.TryGetComponent <ItemModProjectile>(out component) && component.IsAmmo(ammoType)) { return(true); } if (contents != null) { return(contents.HasAmmo(ammoType)); } return(false); }